From 682a0b0debc53019d716f1fafa3e510742ec49d7 Mon Sep 17 00:00:00 2001 From: Adrian Salceanu Date: Tue, 7 Sep 2021 15:37:57 +0200 Subject: [PATCH] v2 - transactions --- Project.toml | 4 ++-- src/SearchLightPostgreSQL.jl | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 86b2bd1..29dbc8f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SearchLightPostgreSQL" uuid = "4327cdd6-4902-11ea-0272-430cea0431bd" authors = ["Adrian Salceanu "] -version = "1" +version = "2.0.0" [deps] DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" @@ -12,5 +12,5 @@ SearchLight = "340e8cb6-72eb-11e8-37ce-c97ebeb32050" [compat] DataFrames = "1" LibPQ = "1" -SearchLight = "1" +SearchLight = "2" julia = "1" diff --git a/src/SearchLightPostgreSQL.jl b/src/SearchLightPostgreSQL.jl index 31fcced..a8edfc8 100644 --- a/src/SearchLightPostgreSQL.jl +++ b/src/SearchLightPostgreSQL.jl @@ -405,6 +405,30 @@ function SearchLight.Migration.column_id_sequence(table_name::Union{String,Symbo end +#### TRANSACTIONS #### + + +function SearchLight.Transactions.begin_transaction() :: Nothing + SearchLight.query("BEGIN") + + nothing +end + + +function SearchLight.Transactions.commit_transaction() :: Nothing + SearchLight.query("COMMIT") + + nothing +end + + +function SearchLight.Transactions.rollback_transaction() :: Nothing + SearchLight.query("ROLLBACK") + + nothing +end + + #### GENERATOR ####