Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 99b22b04
authored
Dec 30, 2024
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bug fixed pembuatan schema
1 parent
1927989d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
opensipkd/base/scripts/initializedb.py
opensipkd/base/scripts/initializedb.py
View file @
99b22b0
...
@@ -88,17 +88,10 @@ def usage(argv):
...
@@ -88,17 +88,10 @@ def usage(argv):
def
create_schema
(
engine
,
schema
):
def
create_schema
(
engine
,
schema
):
# sql = select(text('schema_name')).select_from(
# text('information_schema.schemata')).where(
# text("schema_name = '%s'" % schema))
# if isinstance(engine.dialect, oracle.dialect):
# sql = select(['owner']).select_from('dba_segments').where(
# "owner = '%s'" % schema.upper())
# log.debug(sql)
with
engine
.
connect
()
as
conn
:
with
engine
.
connect
()
as
conn
:
sql
=
CreateSchema
(
schema
,
if_not_exists
=
True
)
sql
=
CreateSchema
(
schema
,
if_not_exists
=
True
)
log
.
debug
(
f
"Execute: {sql}"
)
conn
.
execute
(
sql
)
conn
.
execute
(
sql
)
conn
.
commit
()
def
read_file
(
filename
):
def
read_file
(
filename
):
...
@@ -444,4 +437,4 @@ def main(argv=sys.argv):
...
@@ -444,4 +437,4 @@ def main(argv=sys.argv):
transaction
.
commit
()
transaction
.
commit
()
restore_csv
(
ResKecamatan
,
'kecamatan.csv'
)
restore_csv
(
ResKecamatan
,
'kecamatan.csv'
)
transaction
.
commit
()
transaction
.
commit
()
restore_csv
(
ResDesa
,
'desa.csv'
)
\ No newline at end of file
\ No newline at end of file
restore_csv
(
ResDesa
,
'desa.csv'
)
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