diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/world/db/jdbc.lux | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/stdlib/source/library/lux/world/db/jdbc.lux b/stdlib/source/library/lux/world/db/jdbc.lux index 0d1112282..5ee34d9f7 100644 --- a/stdlib/source/library/lux/world/db/jdbc.lux +++ b/stdlib/source/library/lux/world/db/jdbc.lux @@ -50,33 +50,33 @@ (import: java/sql/DriverManager (#static getConnection [java/lang/String java/lang/String java/lang/String] #io #try java/sql/Connection)) -(type: #export Credentials +(type: .public Credentials {#url URL #user Text #password Text}) -(type: #export ID Int) +(type: .public ID Int) -(type: #export (Statement input) +(type: .public (Statement input) {#sql sql.Statement #input (Input input) #value input}) (template [<name> <forge> <output>] - [(capability: #export (<name> ! i) + [(capability: .public (<name> ! i) (<forge> (Statement i) (! (Try <output>))))] [Can_Execute can_execute Nat] [Can_Insert can_insert (List ID)] ) -(capability: #export (Can_Query ! i o) +(capability: .public (Can_Query ! i o) (can_query [(Statement i) (Output o)] (! (Try (List o))))) -(capability: #export (Can_Close !) +(capability: .public (Can_Close !) (can_close Any (! (Try Any)))) -(interface: #export (DB !) +(interface: .public (DB !) (: (Can_Execute !) execute) (: (Can_Insert !) @@ -100,7 +100,7 @@ _ (java/sql/Statement::close prepared)] (in result))) -(def: #export (async db) +(def: .public (async db) (-> (DB IO) (DB Async)) (`` (implementation (~~ (template [<name> <forge>] @@ -111,7 +111,7 @@ [close can_close] [query can_query]))))) -(def: #export (connect creds) +(def: .public (connect creds) (-> Credentials (IO (Try (DB IO)))) (do (try.with io.monad) [connection (java/sql/DriverManager::getConnection (get@ #url creds) @@ -153,7 +153,7 @@ (/output.rows output result_set))))))) ))))) -(def: #export (with_db creds action) +(def: .public (with_db creds action) (All [a] (-> Credentials (-> (DB IO) (IO (Try a))) @@ -164,7 +164,7 @@ _ (!.use (\ db close) [])] (in result))) -(def: #export (with_async_db creds action) +(def: .public (with_async_db creds action) (All [a] (-> Credentials (-> (DB Async) (Async (Try a))) |