feat: support MariaDB system version table

This commit is contained in:
tianzhou
2023-12-19 12:29:37 +08:00
parent 2c6ec0ce78
commit 4031d3fc84

View File

@ -88,7 +88,8 @@ const getTableSchema = async (connection: Connection, databaseName: string): Pro
const conn = await getMySQLConnection(connection);
// get All tableList from database
const [rows] = await conn.query<RowDataPacket[]>(
`SELECT TABLE_NAME as table_name FROM information_schema.tables WHERE TABLE_SCHEMA=? AND TABLE_TYPE='BASE TABLE';`,
// SYSTEM VERSIONED is a special table for MariaDB https://mariadb.com/kb/en/system-versioned-tables/
`SELECT TABLE_NAME as table_name FROM information_schema.tables WHERE TABLE_SCHEMA=? AND (TABLE_TYPE='BASE TABLE' || TABLE_TYPE='SYSTEM VERSIONED');`,
[databaseName]
);
const tableList = [];