2021-05-27 08:53:53 +00:00
|
|
|
const views = {
|
|
|
|
type: 'views',
|
|
|
|
create1: 'CREATE VIEW obj1 AS SELECT id FROM t1',
|
|
|
|
create2: 'CREATE VIEW obj2 AS SELECT id FROM t2',
|
|
|
|
drop1: 'DROP VIEW obj1',
|
|
|
|
drop2: 'DROP VIEW obj2',
|
|
|
|
};
|
2021-05-28 20:18:06 +00:00
|
|
|
const matviews = {
|
|
|
|
type: 'matviews',
|
|
|
|
create1: 'CREATE MATERIALIZED VIEW obj1 AS SELECT id FROM t1',
|
|
|
|
create2: 'CREATE MATERIALIZED VIEW obj2 AS SELECT id FROM t2',
|
|
|
|
drop1: 'DROP MATERIALIZED VIEW obj1',
|
|
|
|
drop2: 'DROP MATERIALIZED VIEW obj2',
|
|
|
|
};
|
2021-05-27 08:53:53 +00:00
|
|
|
|
2021-05-27 07:12:21 +00:00
|
|
|
const engines = [
|
2021-05-27 11:07:58 +00:00
|
|
|
{
|
|
|
|
label: 'MySQL',
|
|
|
|
connection: {
|
|
|
|
engine: 'mysql@dbgate-plugin-mysql',
|
|
|
|
password: 'Pwd2020Db',
|
|
|
|
user: 'root',
|
|
|
|
server: 'mysql',
|
|
|
|
port: 3306,
|
|
|
|
},
|
|
|
|
local: {
|
|
|
|
server: 'localhost',
|
|
|
|
port: 15001,
|
|
|
|
},
|
2021-05-27 13:51:54 +00:00
|
|
|
// skipOnCI: true,
|
2021-05-27 11:07:58 +00:00
|
|
|
objects: [views],
|
2021-05-27 16:30:49 +00:00
|
|
|
dbSnapshotBySeconds: true,
|
2024-09-27 06:33:16 +00:00
|
|
|
dumpFile: 'data/chinook-mysql.sql',
|
|
|
|
dumpChecks: [
|
|
|
|
{
|
|
|
|
sql: 'select count(*) as res from genre',
|
|
|
|
res: '25',
|
|
|
|
},
|
|
|
|
],
|
2021-05-27 11:07:58 +00:00
|
|
|
},
|
2022-06-02 08:57:53 +00:00
|
|
|
{
|
|
|
|
label: 'MariaDB',
|
|
|
|
connection: {
|
|
|
|
engine: 'mariadb@dbgate-plugin-mysql',
|
|
|
|
password: 'Pwd2020Db',
|
|
|
|
user: 'root',
|
|
|
|
server: 'mysql',
|
|
|
|
port: 3306,
|
|
|
|
},
|
|
|
|
local: {
|
|
|
|
server: 'localhost',
|
|
|
|
port: 15004,
|
|
|
|
},
|
|
|
|
skipOnCI: true,
|
|
|
|
objects: [views],
|
|
|
|
dbSnapshotBySeconds: true,
|
2024-09-27 06:33:16 +00:00
|
|
|
dumpFile: 'data/chinook-mysql.sql',
|
|
|
|
dumpChecks: [
|
|
|
|
{
|
|
|
|
sql: 'select count(*) as res from genre',
|
|
|
|
res: '25',
|
|
|
|
},
|
|
|
|
],
|
2022-06-02 08:57:53 +00:00
|
|
|
},
|
2021-05-27 07:26:37 +00:00
|
|
|
{
|
|
|
|
label: 'PostgreSQL',
|
|
|
|
connection: {
|
|
|
|
engine: 'postgres@dbgate-plugin-postgres',
|
|
|
|
password: 'Pwd2020Db',
|
|
|
|
user: 'postgres',
|
2021-05-27 11:07:58 +00:00
|
|
|
server: 'postgres',
|
2021-05-27 10:38:27 +00:00
|
|
|
port: 5432,
|
2021-05-27 07:26:37 +00:00
|
|
|
},
|
2021-05-27 11:07:58 +00:00
|
|
|
local: {
|
|
|
|
server: 'localhost',
|
|
|
|
port: 15000,
|
|
|
|
},
|
2021-05-27 09:21:25 +00:00
|
|
|
objects: [
|
|
|
|
views,
|
2021-05-28 20:18:06 +00:00
|
|
|
matviews,
|
2021-05-27 09:21:25 +00:00
|
|
|
{
|
|
|
|
type: 'procedures',
|
|
|
|
create1: 'CREATE PROCEDURE obj1() LANGUAGE SQL AS $$ select * from t1 $$',
|
|
|
|
create2: 'CREATE PROCEDURE obj2() LANGUAGE SQL AS $$ select * from t2 $$',
|
|
|
|
drop1: 'DROP PROCEDURE obj1',
|
|
|
|
drop2: 'DROP PROCEDURE obj2',
|
|
|
|
},
|
2021-06-10 12:11:26 +00:00
|
|
|
{
|
|
|
|
type: 'functions',
|
2021-09-04 19:06:42 +00:00
|
|
|
create1:
|
|
|
|
'CREATE FUNCTION obj1() returns int LANGUAGE plpgsql AS $$ declare res integer; begin select count(*) into res from t1; return res; end; $$',
|
|
|
|
create2:
|
|
|
|
'CREATE FUNCTION obj2() returns int LANGUAGE plpgsql AS $$ declare res integer; begin select count(*) into res from t2; return res; end; $$',
|
2021-06-10 12:11:26 +00:00
|
|
|
drop1: 'DROP FUNCTION obj1',
|
|
|
|
drop2: 'DROP FUNCTION obj2',
|
|
|
|
},
|
2021-05-27 09:21:25 +00:00
|
|
|
],
|
2024-09-18 14:01:02 +00:00
|
|
|
supportSchemas: true,
|
2024-10-31 09:48:32 +00:00
|
|
|
supportRenameSqlObject: true,
|
2024-09-19 11:41:49 +00:00
|
|
|
defaultSchemaName: 'public',
|
2024-09-27 06:33:16 +00:00
|
|
|
dumpFile: 'data/chinook-postgre.sql',
|
|
|
|
dumpChecks: [
|
|
|
|
{
|
|
|
|
sql: 'select count(*) as res from "public"."Genre"',
|
|
|
|
res: '25',
|
|
|
|
},
|
|
|
|
],
|
2021-05-27 07:26:37 +00:00
|
|
|
},
|
2021-05-27 11:07:58 +00:00
|
|
|
{
|
|
|
|
label: 'SQL Server',
|
|
|
|
connection: {
|
|
|
|
engine: 'mssql@dbgate-plugin-mssql',
|
|
|
|
password: 'Pwd2020Db',
|
|
|
|
user: 'sa',
|
|
|
|
server: 'mssql',
|
|
|
|
port: 1433,
|
|
|
|
},
|
|
|
|
local: {
|
|
|
|
server: 'localhost',
|
|
|
|
port: 15002,
|
|
|
|
},
|
|
|
|
objects: [
|
|
|
|
views,
|
|
|
|
{
|
|
|
|
type: 'procedures',
|
|
|
|
create1: 'CREATE PROCEDURE obj1 AS SELECT id FROM t1',
|
|
|
|
create2: 'CREATE PROCEDURE obj2 AS SELECT id FROM t2',
|
|
|
|
drop1: 'DROP PROCEDURE obj1',
|
|
|
|
drop2: 'DROP PROCEDURE obj2',
|
|
|
|
},
|
|
|
|
],
|
2024-09-18 14:01:02 +00:00
|
|
|
supportSchemas: true,
|
2024-10-31 09:48:32 +00:00
|
|
|
supportRenameSqlObject: true,
|
2024-09-19 11:41:49 +00:00
|
|
|
defaultSchemaName: 'dbo',
|
2024-09-20 11:30:39 +00:00
|
|
|
// skipSeparateSchemas: true,
|
2021-05-27 11:07:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'SQLite',
|
|
|
|
generateDbFile: true,
|
|
|
|
connection: {
|
|
|
|
engine: 'sqlite@dbgate-plugin-sqlite',
|
|
|
|
},
|
|
|
|
objects: [views],
|
2024-09-20 08:47:51 +00:00
|
|
|
skipOnCI: false,
|
2021-05-27 11:07:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'CockroachDB',
|
|
|
|
connection: {
|
|
|
|
engine: 'cockroach@dbgate-plugin-postgres',
|
|
|
|
user: 'root',
|
|
|
|
server: 'cockroachdb',
|
|
|
|
port: 26257,
|
|
|
|
},
|
|
|
|
local: {
|
|
|
|
server: 'localhost',
|
|
|
|
port: 15003,
|
|
|
|
},
|
2021-05-28 13:47:48 +00:00
|
|
|
skipOnCI: true,
|
2021-05-30 08:34:52 +00:00
|
|
|
objects: [views, matviews],
|
2021-05-27 11:07:58 +00:00
|
|
|
},
|
2024-09-13 11:09:33 +00:00
|
|
|
{
|
|
|
|
label: 'ClickHouse',
|
|
|
|
connection: {
|
|
|
|
engine: 'clickhouse@dbgate-plugin-clickhouse',
|
|
|
|
databaseUrl: 'http://clickhouse:8123',
|
|
|
|
password: 'Pwd2020Db',
|
|
|
|
},
|
|
|
|
local: {
|
|
|
|
databaseUrl: 'http://localhost:15005',
|
|
|
|
},
|
2024-09-16 07:51:01 +00:00
|
|
|
skipOnCI: false,
|
2024-09-13 11:09:33 +00:00
|
|
|
objects: [views],
|
|
|
|
skipDataModifications: true,
|
|
|
|
skipReferences: true,
|
|
|
|
skipIndexes: true,
|
|
|
|
skipNullability: true,
|
|
|
|
skipUnique: true,
|
2024-09-13 13:10:58 +00:00
|
|
|
skipAutoIncrement: true,
|
|
|
|
skipPkColumnTesting: true,
|
2024-09-13 13:24:29 +00:00
|
|
|
skipDataDuplicator: true,
|
2024-09-13 14:11:38 +00:00
|
|
|
skipStringLength: true,
|
2024-09-16 07:47:44 +00:00
|
|
|
alterTableAddColumnSyntax: true,
|
|
|
|
dbSnapshotBySeconds: true,
|
2024-09-13 11:09:33 +00:00
|
|
|
},
|
2021-05-27 07:12:21 +00:00
|
|
|
];
|
|
|
|
|
2021-09-05 09:01:52 +00:00
|
|
|
const filterLocal = [
|
|
|
|
// filter local testing
|
2024-11-07 13:05:13 +00:00
|
|
|
'MySQL',
|
2024-10-01 08:37:05 +00:00
|
|
|
'-MariaDB',
|
2024-11-07 13:05:13 +00:00
|
|
|
'-PostgreSQL',
|
2024-11-06 11:01:43 +00:00
|
|
|
'-SQL Server',
|
2024-09-27 06:33:16 +00:00
|
|
|
'-SQLite',
|
2021-11-11 07:25:23 +00:00
|
|
|
'-CockroachDB',
|
2024-10-31 09:00:40 +00:00
|
|
|
'-ClickHouse',
|
2021-09-05 09:01:52 +00:00
|
|
|
];
|
|
|
|
|
2022-06-12 06:15:35 +00:00
|
|
|
const enginesPostgre = engines.filter(x => x.label == 'PostgreSQL');
|
|
|
|
|
2021-09-05 09:01:52 +00:00
|
|
|
module.exports = process.env.CITEST
|
|
|
|
? engines.filter(x => !x.skipOnCI)
|
|
|
|
: engines.filter(x => filterLocal.find(y => x.label == y));
|
2022-06-12 06:15:35 +00:00
|
|
|
|
|
|
|
module.exports.enginesPostgre = enginesPostgre;
|