preloaded data works

This commit is contained in:
Jan Prochazka
2021-11-27 17:49:02 +01:00
parent d4f4211ee4
commit 40d53275e3
12 changed files with 177 additions and 5 deletions

View File

@@ -221,4 +221,33 @@ describe('Deploy database', () => {
);
})
);
test.each(engines.map(engine => [engine.label, engine]))(
'Deploy preloaded data - %s',
testWrapper(async (conn, driver, engine) => {
await testDatabaseDeploy(conn, driver, [
[
{
name: 't1.table.yaml',
json: {
name: 't1',
columns: [
{ name: 'id', type: 'int' },
{ name: 'value', type: 'int' },
],
primaryKey: ['id'],
data: [
{ id: 1, value: 1 },
{ id: 2, value: 2 },
{ id: 3, value: 3 },
],
},
},
],
]);
const res = await driver.query(conn, `select count(*) as cnt from t1`);
expect(res.rows[0].cnt.toString()).toEqual('3');
})
);
});

View File

@@ -118,7 +118,7 @@ const filterLocal = [
// filter local testing
'MySQL',
'PostgreSQL',
'SQL Server',
'-SQL Server',
'SQLite',
'-CockroachDB',
];