(config: ExportConfig)
| 957 | }; |
| 958 | |
| 959 | export const prepareAndExportLibSQL = async (config: ExportConfig) => { |
| 960 | const schemaPath = config.schema; |
| 961 | |
| 962 | try { |
| 963 | const { prev, cur, custom } = await prepareSqliteMigrationSnapshot( |
| 964 | [], |
| 965 | schemaPath, |
| 966 | undefined, |
| 967 | ); |
| 968 | |
| 969 | const validatedPrev = sqliteSchema.parse(prev); |
| 970 | const validatedCur = sqliteSchema.parse(cur); |
| 971 | |
| 972 | const squashedPrev = squashSqliteScheme(validatedPrev); |
| 973 | const squashedCur = squashSqliteScheme(validatedCur); |
| 974 | |
| 975 | const { sqlStatements, _meta } = await applyLibSQLSnapshotsDiff( |
| 976 | squashedPrev, |
| 977 | squashedCur, |
| 978 | tablesResolver, |
| 979 | columnsResolver, |
| 980 | sqliteViewsResolver, |
| 981 | validatedPrev, |
| 982 | validatedCur, |
| 983 | ); |
| 984 | |
| 985 | console.log(sqlStatements.join('\n')); |
| 986 | } catch (e) { |
| 987 | console.error(e); |
| 988 | } |
| 989 | }; |
| 990 | |
| 991 | export const prepareSQLitePush = async ( |
| 992 | schemaPath: string | string[], |
no test coverage detected