Closed andrew-farries closed 5 months ago
Add a new WithSQLTransformer option to rewrite the user-defined SQL used to define up and down triggers.
WithSQLTransformer
up
down
The intention is that the transformer be used to sanitize user-input SQL.
Transformers implement the following interface:
type SQLTransformer interface { Transform(sql string) (string, error) }
and are used by the createTrigger function to rewrite the up or down SQL before using it in the trigger function definition.
createTrigger
Later PRs will use the same transformer to rewrite the up and down values used in raw SQL migrations and column DEFAULT expressions.
DEFAULT
Add a new
WithSQLTransformer
option to rewrite the user-defined SQL used to defineup
anddown
triggers.The intention is that the transformer be used to sanitize user-input SQL.
Transformers implement the following interface:
and are used by the
createTrigger
function to rewrite theup
ordown
SQL before using it in the trigger function definition.Later PRs will use the same transformer to rewrite the
up
anddown
values used in raw SQL migrations and columnDEFAULT
expressions.