Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
maintenance
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a5245c8c
authored
Mar 14, 2024
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Mengganti engine.execute() dengan conn.execute()
1 parent
0abe80fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
CHANGES.txt
log_table/set_trigger.py
CHANGES.txt
View file @
a5245c8
0.8.2 14-3-2024
---------------
- Mengganti engine.execute() dengan conn.execute() sesuai SQLAlchemy yang baru.
0.8.1 21-5-2023
0.8.1 21-5-2023
---------------
---------------
- Memahami mirror status versi 9.1
- Memahami mirror status versi 9.1
...
...
log_table/set_trigger.py
View file @
a5245c8
...
@@ -33,7 +33,8 @@ def main(argv=sys.argv[1:]):
...
@@ -33,7 +33,8 @@ def main(argv=sys.argv[1:]):
trigger_name
=
f
'log_table_{operation}'
trigger_name
=
f
'log_table_{operation}'
sql
=
f
'DROP TRIGGER {trigger_name} ON {table_name}'
sql
=
f
'DROP TRIGGER {trigger_name} ON {table_name}'
try
:
try
:
engine
.
execute
(
text
(
sql
))
with
engine
.
connect
()
as
conn
:
conn
.
execute
(
text
(
sql
))
except
exc
.
ProgrammingError
as
e
:
except
exc
.
ProgrammingError
as
e
:
s
=
str
(
e
)
s
=
str
(
e
)
if
s
.
find
(
'does not exist'
)
==
-
1
:
if
s
.
find
(
'does not exist'
)
==
-
1
:
...
@@ -41,4 +42,5 @@ def main(argv=sys.argv[1:]):
...
@@ -41,4 +42,5 @@ def main(argv=sys.argv[1:]):
sql
=
f
'CREATE TRIGGER {trigger_name} '
\
sql
=
f
'CREATE TRIGGER {trigger_name} '
\
f
'AFTER {operation} ON {table_name} '
\
f
'AFTER {operation} ON {table_name} '
\
f
'FOR EACH ROW EXECUTE PROCEDURE log_table_after_{operation}()'
f
'FOR EACH ROW EXECUTE PROCEDURE log_table_after_{operation}()'
engine
.
execute
(
text
(
sql
))
with
engine
.
connect
()
as
conn
:
conn
.
execute
(
text
(
sql
))
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment