lava-oushudb-dt-sql-parser/test/parser/flinksql/syntax/insertStatement.test.ts
Hayden 7de192d486
chroe: devops (#180)
* ci: add dependencies about lint tool

* ci: replace eslint with prettier

* ci: add husky, cz and commitlint

* style: lint fix via prettier

* ci: add prettier and check-types to github workflow

'
2023-10-13 11:16:36 +08:00

29 lines
1.0 KiB
TypeScript

import FlinkSQL from '../../../../src/parser/flinksql';
import { readSQL } from '../../../helper';
const parser = new FlinkSQL();
const features = {
InsertFromSelectQueries: readSQL(__dirname, 'insertFromSelectQueries.sql'),
InsertValuesIntoTable: readSQL(__dirname, 'insertValuesIntoTable.sql'),
InsertMultipleTable: readSQL(__dirname, 'insertMultipleTable.sql'),
};
describe('FlinkSQL Insert Syntax Tests', () => {
features.InsertFromSelectQueries.forEach((insertFromSelectQueries) => {
it(insertFromSelectQueries, () => {
expect(parser.validate(insertFromSelectQueries).length).toBe(0);
});
});
features.InsertValuesIntoTable.forEach((insertValuesIntoTable) => {
it(insertValuesIntoTable, () => {
expect(parser.validate(insertValuesIntoTable).length).toBe(0);
});
});
features.InsertMultipleTable.forEach((insertMultipleTable) => {
it(insertMultipleTable, () => {
expect(parser.validate(insertMultipleTable).length).toBe(0);
});
});
});