Module

Yoga.Postgres.TypedQueryOm

Package
purescript-yoga-postgres-om
Repository
rowtype-yoga/purescript-yoga-postgres-om

#executeSql Source

executeSql :: forall @params @result r err. HFoldlWithIndex TurnIntoSQLParam (Map String SQLParameter) (Record params) (Map String SQLParameter) => ReadForeign result => SQLQuery params -> Record params -> Om { postgresConnection :: Connection | r } (parseError :: String | err) (Array result)

Execute a typed SQL query in Om context Automatically gets Connection from Om context Throws parse errors to the Om exception channel

#executeSqlOne Source

executeSqlOne :: forall @params @result r err. HFoldlWithIndex TurnIntoSQLParam (Map String SQLParameter) (Record params) (Map String SQLParameter) => ReadForeign result => SQLQuery params -> Record params -> Om { postgresConnection :: Connection | r } (parseError :: String | err) (Maybe result)

Execute a typed SQL query and return a single row in Om context

#executeMutation Source

executeMutation :: forall @params r err. HFoldlWithIndex TurnIntoSQLParam (Map String SQLParameter) (Record params) (Map String SQLParameter) => SQLQuery params -> Record params -> Om { postgresConnection :: Connection | r } err Int

Execute a mutation in Om context

#executeSqlRaw Source

executeSqlRaw :: forall @params r err. HFoldlWithIndex TurnIntoSQLParam (Map String SQLParameter) (Record params) (Map String SQLParameter) => SQLQuery params -> Record params -> Om { postgresConnection :: Connection | r } err QueryResult

Execute raw query (no parsing) in Om context