Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
semint-kprime-arm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pedot Nicola
semint-kprime-arm
Commits
f7a4324d
Commit
f7a4324d
authored
4 years ago
by
npedot
Browse files
Options
Downloads
Patches
Plain Diff
adds if not exists to sql create table
parent
6c223d51
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/kotlin/unibz.cs.semint.kprime/usecase/common/SQLizeCreateUseCase.kt
+4
-2
4 additions, 2 deletions
...bz.cs.semint.kprime/usecase/common/SQLizeCreateUseCase.kt
with
4 additions
and
2 deletions
src/main/kotlin/unibz.cs.semint.kprime/usecase/common/SQLizeCreateUseCase.kt
+
4
−
2
View file @
f7a4324d
...
...
@@ -69,10 +69,12 @@ class SQLizeCreateUseCase {
private
fun
createTableCommand
(
createTable
:
CreateTable
):
String
{
var
cols
=
" "
for
(
col
in
createTable
.
columns
)
{
cols
+=
"${col.name} ${col.dbtype} ,"
var
colType
=
col
.
dbtype
if
(
colType
==
null
||
colType
.
trim
().
isEmpty
())
colType
=
"varchar(64)"
cols
+=
"${col.name} ${colType} ,"
}
cols
=
cols
.
dropLast
(
2
)
return
"CREATE TABLE ${createTable.name} ($cols);"
return
"CREATE TABLE
IF NOT EXISTS
${createTable.name} ($cols);"
}
private
fun
createViewCommand
(
createView
:
CreateView
):
String
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment