Mercurial > cgi-bin > hgweb.cgi > PassMan
comparison src/main/kotlin/name/blackcap/passman/RenameSubcommand.kt @ 15:0fc90892a3ae
Add password subcommand.
author | David Barts <n5jrn@me.com> |
---|---|
date | Fri, 03 Feb 2023 18:48:13 -0800 |
parents | 4dae7a15ee48 |
children | ea65ab890f66 |
comparison
equal
deleted
inserted
replaced
14:4dae7a15ee48 | 15:0fc90892a3ae |
---|---|
93 db.connection.prepareStatement("delete from passwords where id = ?").use { | 93 db.connection.prepareStatement("delete from passwords where id = ?").use { |
94 it.setLong(1, id); | 94 it.setLong(1, id); |
95 it.executeUpdate() | 95 it.executeUpdate() |
96 } | 96 } |
97 } | 97 } |
98 | |
99 private fun PreparedStatement.setDateOrNull(parameterIndex: Int, value: Long?) { | |
100 if (value == null || value == 0L) { | |
101 setNull(parameterIndex, Types.INTEGER) | |
102 } else { | |
103 setLong(parameterIndex, value) | |
104 } | |
105 } | |
106 } | 98 } |