...
|
...
|
@@ -33,6 +33,7 @@ func (repository *TableRepository) Save(table *domain.Table) (*domain.Table, err |
|
|
"row_count",
|
|
|
"context",
|
|
|
"table_info",
|
|
|
"apply_at",
|
|
|
}
|
|
|
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlbuilder.RemoveSqlFields(sqlBuildFields, "table_id", "deleted_at"))
|
|
|
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlbuilder.RemoveSqlFields(sqlBuildFields, "table_id", "deleted_at"))
|
...
|
...
|
@@ -59,6 +60,7 @@ func (repository *TableRepository) Save(table *domain.Table) (*domain.Table, err |
|
|
&table.RowCount,
|
|
|
&table.Context,
|
|
|
&table.TableInfo,
|
|
|
&table.ApplyAt,
|
|
|
),
|
|
|
fmt.Sprintf("INSERT INTO metadata.tables (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
|
|
|
table.TableType,
|
...
|
...
|
@@ -75,6 +77,7 @@ func (repository *TableRepository) Save(table *domain.Table) (*domain.Table, err |
|
|
table.RowCount,
|
|
|
table.Context,
|
|
|
table.TableInfo,
|
|
|
table.ApplyAt,
|
|
|
); err != nil {
|
|
|
return table, err
|
|
|
}
|
...
|
...
|
@@ -99,6 +102,7 @@ func (repository *TableRepository) Save(table *domain.Table) (*domain.Table, err |
|
|
&table.RowCount,
|
|
|
&table.Context,
|
|
|
&table.TableInfo,
|
|
|
&table.ApplyAt,
|
|
|
),
|
|
|
fmt.Sprintf("UPDATE metadata.tables SET %s WHERE table_id=? and version=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
|
|
|
table.TableType,
|
...
|
...
|
@@ -115,6 +119,7 @@ func (repository *TableRepository) Save(table *domain.Table) (*domain.Table, err |
|
|
table.RowCount,
|
|
|
table.Context,
|
|
|
table.TableInfo,
|
|
|
table.ApplyAt,
|
|
|
table.Identify(),
|
|
|
oldVersion,
|
|
|
); err != nil {
|
...
|
...
|
|