( statements: JsonStatement[], dialect: Dialect, action?: 'push', json2?: SQLiteSchemaSquashed, )
| 4120 | convertors.push(new SingleStoreAlterTableAddPk()); |
| 4121 | |
| 4122 | export function fromJson( |
| 4123 | statements: JsonStatement[], |
| 4124 | dialect: Dialect, |
| 4125 | action?: 'push', |
| 4126 | json2?: SQLiteSchemaSquashed, |
| 4127 | ) { |
| 4128 | const result = statements |
| 4129 | .flatMap((statement) => { |
| 4130 | const filtered = convertors.filter((it) => { |
| 4131 | return it.can(statement, dialect); |
| 4132 | }); |
| 4133 | |
| 4134 | const convertor = filtered.length === 1 ? filtered[0] : undefined; |
| 4135 | |
| 4136 | if (!convertor) { |
| 4137 | return ''; |
| 4138 | } |
| 4139 | |
| 4140 | return convertor.convert(statement, json2, action); |
| 4141 | }) |
| 4142 | .filter((it) => it !== ''); |
| 4143 | return result; |
| 4144 | } |
| 4145 | |
| 4146 | // blog.yo1.dog/updating-enum-values-in-postgresql-the-safe-and-easy-way/ |
| 4147 | // test case for enum altering |
no test coverage detected