@@ -106,7 +106,7 @@ f64DocsTable :: Proxy F64DocsTable
106106f64DocsTable = Proxy
107107
108108type RandomRowIdTable = Table "things"
109− ( id :: Int # PrimaryKey # AutoIncrement # RandomRowId
109+ ( id :: Int # PrimaryKey # RandomRowId
110110 , name :: String
111111 )
112112
@@ -686,10 +686,29 @@ spec = before setupConn do
686686 let actives = map (\r -> r.active) (rows :: Array { id :: Int, active :: SQLiteBool, role :: String, score :: Int })
687687 actives `shouldEqual` [SQLiteBool false]
688688
689+ it "RandomRowId column excluded from typed insert" \conn -> do
690+ SQLite.executeSimple (SQLite.SQL (createTableDDL @RandomRowIdTable)) conn # void
691+ runExecute conn {} (from (Proxy :: Proxy RandomRowIdTable) # insert { name: "hello" }) # void
692+ rows <- runQuery conn {} (from (Proxy :: Proxy RandomRowIdTable) # select @"name")
693+ let names = map (_.name) (rows :: Array { name :: String })
694+ names `shouldEqual` ["hello"]
695+
696+ it "DateTime as SQLiteValue in batch" \conn -> do
697+ SQLite.executeSimple (SQLite.SQL (createTableDDL @EventsTable)) conn # void
698+ SQLite.execute
699+ (SQLite.SQL "INSERT INTO events (title, metadata, created_at) VALUES (?1, ?2, ?3)")
700+ [ SQLite.toSQLiteValue "test"
701+ , SQLite.toSQLiteValue "{}"
702+ , SQLite.toSQLiteValue testDateTime
703+ ]
704+ conn # void
705+ rows <- runQuery conn {} (from eventsTable # selectAll)
706+ Array.length rows `shouldEqual` 1
707+
689708 describe "DDL RANDOM ROWID" do
690709 it "generates DDL with RANDOM ROWID suffix" \_ -> do
691710 let result = createTableDDL @RandomRowIdTable
692− result `shouldEqual` "CREATE TABLE things (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL) RANDOM ROWID"
711+ result `shouldEqual` "CREATE TABLE things (id INTEGER NOT NULL PRIMARY KEY, name TEXT NOT NULL) RANDOM ROWID"
693712
694713 describe "DDL F64Vector" do
695714 it "createTableDDL with F64Vector" \_ -> do