aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/out_sqlite.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2022-11-16 13:02:42 -0500
committerRalph Amissah <ralph.amissah@gmail.com>2022-11-21 11:29:23 -0500
commit2bbbda58a5e2c56be6ad88ad3a296ec1b2a833fb (patch)
treebbe4a1f37027358963a46f21a0a8b0389ea4a74d /org/out_sqlite.org
parentregex (start thinking about ctRegex) (diff)
configs housekeeping, minor
Diffstat (limited to 'org/out_sqlite.org')
-rw-r--r--org/out_sqlite.org64
1 files changed, 36 insertions, 28 deletions
diff --git a/org/out_sqlite.org b/org/out_sqlite.org
index a6c501d..3a201e7 100644
--- a/org/out_sqlite.org
+++ b/org/out_sqlite.org
@@ -346,35 +346,43 @@ template SQLiteTablesCreate() {
return _sql_instruct;
}
}
- if (opt_action.sqlite_db_create) {
- string _db_statement;
- string db_filename = (opt_action.sqliteDB_filename.length > 0)
- ? opt_action.sqliteDB_filename
- : (config.conf.w_srv_db_sqlite_filename.length > 0)
- ? config.conf.w_srv_db_sqlite_filename
- : "";
- string db_path = (opt_action.sqliteDB_path.length > 0)
- ? opt_action.sqliteDB_path
- : (config.conf.w_srv_db_sqlite_path.length > 0)
- ? config.conf.w_srv_db_sqlite_path
- : "";
- if (db_filename.length > 0 && db_path.length > 0) {
- if ((opt_action.vox_gt1)) {
- writeln("db name & path: ", db_path, db_filename);
- }
- auto pth_sqlite = spinePathsSQLite!()(db_filename, db_path);
- pth_sqlite.base.mkdirRecurse;
- auto db = Database(pth_sqlite.sqlite_file);
- {
- _db_statement ~= SQLiteTablesReCreate!()();
- }
- SQLiteDbRun!()(db, _db_statement, opt_action, "TABLE RE-CREATE");
- } else {
- writeln("must provide db name & output root path either on the command line or in configuration file");
- writeln("db name: ", db_filename);
- writeln("db path: ", db_path);
- }
+ <<sqlite_db_create>>
+ }
+}
+#+END_SRC
+
+**** db create
+
+#+NAME: sqlite_db_create
+#+HEADER: :noweb yes
+#+BEGIN_SRC d
+if (opt_action.sqlite_db_create) {
+ string _db_statement;
+ string db_filename = (opt_action.sqliteDB_filename.length > 0)
+ ? opt_action.sqliteDB_filename
+ : (config.conf.w_srv_db_sqlite_filename.length > 0)
+ ? config.conf.w_srv_db_sqlite_filename
+ : "";
+ string db_path = (opt_action.sqliteDB_path.length > 0)
+ ? opt_action.sqliteDB_path
+ : (config.conf.w_srv_db_sqlite_path.length > 0)
+ ? config.conf.w_srv_db_sqlite_path
+ : "";
+ if (db_filename.length > 0 && db_path.length > 0) {
+ if ((opt_action.vox_gt1)) {
+ writeln("db name & path: ", db_path, db_filename);
+ }
+ auto pth_sqlite = spinePathsSQLite!()(db_filename, db_path);
+ pth_sqlite.base.mkdirRecurse;
+ auto db = Database(pth_sqlite.sqlite_file);
+ {
+ _db_statement ~= SQLiteTablesReCreate!()();
}
+ SQLiteDbRun!()(db, _db_statement, opt_action, "TABLE RE-CREATE");
+ } else {
+ writeln("must provide db name & output root path either on the command line or in configuration file");
+ writeln("db name: ", db_filename);
+ writeln("db path: ", db_path);
}
}
#+END_SRC