lava-oushudb-dt-sql-parser/test/parser/flink/syntax/insertStatement.test.ts
Hayden bb0fad1dbe
refactor: standard naming (#278)
* refactor: rename flinksql to flink

* refactor: rename pgsql to postgresql

* refactor: rename trinosql to trino

* refactor: replace all default exports with named export

* refactor: rename basicParser to basicSQL

* refactor: rename basic-parser-types to types

* refactor: replace arrow func with plain func
2024-03-27 10:33:25 +08:00

29 lines
1.0 KiB
TypeScript

import { FlinkSQL } from 'src/parser/flink';
import { readSQL } from 'test/helper';
const flink = 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(flink.validate(insertFromSelectQueries).length).toBe(0);
});
});
features.InsertValuesIntoTable.forEach((insertValuesIntoTable) => {
it(insertValuesIntoTable, () => {
expect(flink.validate(insertValuesIntoTable).length).toBe(0);
});
});
features.InsertMultipleTable.forEach((insertMultipleTable) => {
it(insertMultipleTable, () => {
expect(flink.validate(insertMultipleTable).length).toBe(0);
});
});
});