diff src/main/kotlin/name/blackcap/passman/Database.kt @ 15:0fc90892a3ae

Add password subcommand.
author David Barts <n5jrn@me.com>
date Fri, 03 Feb 2023 18:48:13 -0800
parents c69665ff37d0
children 7a74ae668665
line wrap: on
line diff
--- a/src/main/kotlin/name/blackcap/passman/Database.kt	Tue Jan 31 19:07:46 2023 -0800
+++ b/src/main/kotlin/name/blackcap/passman/Database.kt	Fri Feb 03 18:48:13 2023 -0800
@@ -149,3 +149,11 @@
     } else {
         setLong(columnIndex, value)
     }
+
+fun PreparedStatement.setDateOrNull(parameterIndex: Int, value: Long?) {
+    if (value == null || value == 0L) {
+        setNull(parameterIndex, Types.INTEGER)
+    } else {
+        setLong(parameterIndex, value)
+    }
+}