-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema generation support #12
Conversation
The error condition in generateValue() is ignored because the error object created with fmt.Errorf() is not returned anywhere. As this is an internal error, let's just call panic() to stop execution.
The schema is currently configured via an external file "schema.json". This commit adds support for generating the schema with the tool. Users can still define the schema themselves via a JSON file with the "--schema" command line option. Fixes #9
1a4e095
to
ee16b56
Compare
func GenSchema() *Schema { | ||
builder := NewSchemaBuilder() | ||
keyspace := Keyspace{ | ||
Name: "ks1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the ks1
a convention? In the old config file it was called gemini
or perhaps this is a different keyspace?
columns = append(columns, ColumnDef{Name: genColumnName("col", i), Type: genColumnType()}) | ||
} | ||
table := Table{ | ||
Name: "table1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the keyspace above. Are they keys into a config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original configuration keyspace and table names were picked at random, like the ones here too. The benefit of this convention is that we can generate multiple keyspaces and tables at a later point.
This pull request implement schema generation in the Gemini tool. Previously, schema was configured via an external file,
schema.json
. This adds a--schema
command line option, which users can use for the old behavior. If no schema file is configured, the tool generates one.Fixes #9.