-
Notifications
You must be signed in to change notification settings - Fork 0
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
Postgres seed #21
Postgres seed #21
Conversation
@nirapx I'm not seeing anything postgress specific in this package...seems like it can be called sql seed and work just as well. Wouldn't it? |
@avivpxi the insert statement is a bit different: I can generalize this usage if you think it's better. In this case, I'll need to pass one more tag for each field |
Got it. Then let's keep it postgress. |
@avivpxi done |
seed/postgres/config.go
Outdated
ClientProvider func() (*sql.DB, error) `json:"-"` | ||
|
||
// Setup - a string that contains the SQL setup script to run before seeding the data. | ||
Setup string `json:"-"` |
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.
Should have json tag
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.
added. where is it being used?
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.
Envite can be used as a cli tool using yaml files...this allows parsing external yaml/json
seed/postgres/config.go
Outdated
// SeedTableData represents data for a Postgres table. | ||
type SeedTableData struct { | ||
// TableName - the name of the target postgres table | ||
TableName string `json:"table,omitempty"` |
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.
Can you align json tag with field name? table_name
@nirapx added 2 last comments |
No description provided.