-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
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.
More comments, looking good! we just need to solve some issues around the comments and where QueryExecer interface should exist.
provider/schema/execution.go
Outdated
type Database interface { | ||
QueryExecer | ||
|
||
Insert(ctx context.Context, t *Table, instance Resources) error | ||
Delete(ctx context.Context, t *Table, kvFilters []interface{}) error | ||
RemoveStaleData(ctx context.Context, t *Table, executionStart time.Time, kvFilters []interface{}) error | ||
CopyFrom(ctx context.Context, resources Resources, shouldCascade bool, CascadeDeleteFilters map[string]interface{}) error | ||
Close() | ||
Dialect() Dialect | ||
} | ||
|
||
type QueryExecer interface { | ||
Exec(ctx context.Context, query string, args ...interface{}) error | ||
Query(ctx context.Context, query string, args ...interface{}) (pgx.Rows, error) | ||
} |
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.
I agree, I think my comments confused a little bit. Would move QueryExecer -> database package (as like you said core packages use it and its a database thing). The Database interface is only used by execution as its an execution thing, and then I would rename it perhaps.
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.
More comments, mostly nitpicks. only one logical one regarding drop/create diffs
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.
LGTM, minor nits left.
Moving migrations only to go-migrate, providing tools to generate SQLs (full and incremental) from
schema.Table
Moving protocol version to
4
Please see relevant PRs on other projects:
cloudquery/cq-provider-aws#401
cloudquery/cloudquery#406
https://github.com/cloudquery/docs/pull/75
https://github.com/cloudquery/cq-provider-template/pull/12