summaryrefslogtreecommitdiff
path: root/Omni/Task/Core.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-11-27 15:21:18 -0500
committerBen Sima <ben@bensima.com>2025-11-27 15:26:30 -0500
commit39791b4552b605fe60d03a5e98c5533bd741b729 (patch)
tree0b7d34a1d9cfb205dc8c5a9da13c94f1531c5cac /Omni/Task/Core.hs
parent15068f1e736288c2d782eada8e24d71375f9ffef (diff)
Fix SQL query and add simple migration test
Diffstat (limited to 'Omni/Task/Core.hs')
-rw-r--r--Omni/Task/Core.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs
index 4eac9b5..63bc533 100644
--- a/Omni/Task/Core.hs
+++ b/Omni/Task/Core.hs
@@ -437,7 +437,8 @@ migrateTable conn tableName expectedCols = do
-- | Get list of column names for a table using PRAGMA table_info
getTableColumns :: SQL.Connection -> Text -> IO [Text]
getTableColumns conn tableName = do
- rows <- SQL.query conn "PRAGMA table_info(?)" (SQL.Only tableName) :: IO [(Int, Text, Text, Int, Maybe Text, Int)]
+ let query = SQL.Query <| "PRAGMA table_info(" <> tableName <> ")"
+ rows <- SQL.query_ conn query :: IO [(Int, Text, Text, Int, Maybe Text, Int)]
pure [colName | (_, colName, _, _, _, _) <- rows]
-- | Add a column to a table