Skip to content

Commit

Permalink
Added more TODO to handle parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnbdz committed Nov 17, 2024
1 parent 2006fde commit 2256e79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 0 additions & 6 deletions cache/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,6 @@ func (s *SDatabase) CreateTable(table Table) error {
return fmt.Errorf(ErrorDatabaseNotInitialized)
}

// TODO: Example of what Id and other columns look like:
/*
Id TEXT PRIMARY KEY,
name TEXT NOT NULL
*/

var sqlColumns string
for _, column := range table.Columns {
sqlColumn := fmt.Sprintf(",\n%s %s %s", column.ColumnName, column.DataType, column.Constraint)
Expand Down
5 changes: 5 additions & 0 deletions cache/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ type SParser struct{}

// Parse
func (s *SParser) ParseEntity(entity entity.Entity) (database.Table, error) {
// TODO: Use schema to determine the data type for the SQL
// string == TEXT
// TODO: Convert schema from the struct to the JSON-Schema string
// TODO: For `Id` always: `Id TEXT PRIMARY KEY,`
// TODO: Maybe always have `NOT NULL` as a constrain. E.g.: name TEXT NOT NULL

return database.Table{}, nil
}
Expand Down

0 comments on commit 2256e79

Please sign in to comment.