summaryrefslogtreecommitdiffstats
path: root/javascripts/libs/ddl_builder/templates/sqlite.sql
diff options
context:
space:
mode:
Diffstat (limited to 'javascripts/libs/ddl_builder/templates/sqlite.sql')
-rw-r--r--javascripts/libs/ddl_builder/templates/sqlite.sql12
1 files changed, 12 insertions, 0 deletions
diff --git a/javascripts/libs/ddl_builder/templates/sqlite.sql b/javascripts/libs/ddl_builder/templates/sqlite.sql
new file mode 100644
index 0000000..2e2b66d
--- /dev/null
+++ b/javascripts/libs/ddl_builder/templates/sqlite.sql
@@ -0,0 +1,12 @@
+"CREATE TABLE {{tablePrefix}}{{tableName}}{{tableSuffix}}
+ ({{#each_with_index columns}}{{#if index}}, {{/if}}{{{../fieldPrefix}}}{{name}}{{{../fieldSuffix}}} {{db_type}}{{/each_with_index}})
+{{separator}}
+
+{{#each_with_index data}}
+INSERT INTO {{tablePrefix}}{{../tableName}}{{tableSuffix}}
+ ({{#each_with_index ../columns}}{{#if index}}, {{/if}}{{{../../fieldPrefix}}}{{name}}{{{../../fieldSuffix}}}{{/each_with_index}})
+VALUES
+ ({{#each_with_index r}}{{#if index}}, {{/if}}{{formatted_field ../..}}{{/each_with_index}})
+{{../separator}}
+
+{{/each_with_index}} \ No newline at end of file