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 62c38f60
authored
Jan 02, 2025
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'beta-4.2' of
https://git.opensipkd.com/aa.gusti/opensipkd-base
into beta-4.2
2 parents
3a1948d0
a340056b
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 @
62c38f6
...
@@ -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