-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
dolt dump
should include views, triggers, and procedures
#3225
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.
LGTM
@@ -147,6 +148,66 @@ func InsertStatementPrefix(tableName string, tableSch schema.Schema) (string, er | |||
return b.String(), nil | |||
} | |||
|
|||
// SqlRowAsCreateProcStmt Converts a Row into either a CREATE PROCEDURE statement |
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.
Mention that this expectes a row from the dolt_procedures table
} | ||
|
||
// SqlRowAsCreateFragStmt Converts a Row into either a CREATE TRIGGER or CREATE VIEW statement | ||
func SqlRowAsCreateFragStmt(r sql.Row) (string, 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.
Mention that this needs a row from the dolt_schemas table
@@ -160,6 +159,61 @@ teardown() { | |||
dolt sql -q "CREATE VIEW view2 AS SELECT y FROM b;" | |||
dolt sql -q "CREATE TRIGGER trigger2 AFTER INSERT ON a FOR EACH ROW INSERT INTO b VALUES (new.x * 2);" | |||
dolt sql -q "INSERT INTO a VALUES (2);" | |||
dolt sql -q "CREATE PROCEDURE p1 (in x int) select x from dual" |
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.
Need a test for a trigger that uses precedes
or follows
syntax:
fix for: #3159
instead of dumping certain dolt tables, create the views, triggers, and procedures.