Updating CI and adding postgres legacy to test suite fully. Also fixing a schema export issue.

This commit is contained in:
mike12345567 2024-12-10 18:00:49 +00:00
parent 340d9c34ff
commit 07c24c16a4
3 changed files with 16 additions and 3 deletions

View File

@ -190,6 +190,8 @@ jobs:
docker pull mariadb@${{ steps.dotenv.outputs.MARIADB_SHA }} docker pull mariadb@${{ steps.dotenv.outputs.MARIADB_SHA }}
elif [ "${{ matrix.datasource }}" == "oracle" ]; then elif [ "${{ matrix.datasource }}" == "oracle" ]; then
docker pull budibase/oracle-database:23.2-slim-faststart docker pull budibase/oracle-database:23.2-slim-faststart
elif [ "${{ matrix.datasource }}" == "postgres_legacy" ]; then
docker pull postgres:9.5.25
fi fi
docker pull minio/minio & docker pull minio/minio &
docker pull redis & docker pull redis &

View File

@ -590,13 +590,13 @@ if (descriptions.length) {
} }
const datasources = datasourceDescribe({ const datasources = datasourceDescribe({
exclude: [DatabaseName.MONGODB, DatabaseName.SQS, DatabaseName.ORACLE], only: [DatabaseName.POSTGRES_LEGACY],
}) })
if (datasources.length) { if (datasources.length) {
describe.each(datasources)( describe.each(datasources)(
"$dbName", "$dbName",
({ config, dsProvider, isPostgres, isMySQL, isMariaDB }) => { ({ config, dsProvider, isPostgres, isLegacy, isMySQL, isMariaDB }) => {
let datasource: Datasource let datasource: Datasource
let client: Knex let client: Knex
@ -647,6 +647,13 @@ if (datasources.length) {
// can load it. We're using postgres 16 in tests at the time of writing. // can load it. We're using postgres 16 in tests at the time of writing.
schema = schema.replace("SET transaction_timeout = 0;", "") schema = schema.replace("SET transaction_timeout = 0;", "")
} }
if (isPostgres && isLegacy) {
// in older versions of Postgres, this is not a valid option - Postgres 9.5 does not support this.
schema = schema.replace(
"SET idle_in_transaction_session_timeout = 0;",
""
)
}
await config.api.table.destroy(table._id!, table._rev!) await config.api.table.destroy(table._id!, table._rev!)

View File

@ -147,7 +147,11 @@ export function datasourceDescribe(opts: DatasourceDescribeOpts) {
DatabaseName.ORACLE, DatabaseName.ORACLE,
].includes(dbName), ].includes(dbName),
isMySQL: dbName === DatabaseName.MYSQL, isMySQL: dbName === DatabaseName.MYSQL,
isPostgres: dbName === DatabaseName.POSTGRES, isPostgres:
dbName === DatabaseName.POSTGRES ||
dbName === DatabaseName.POSTGRES_LEGACY,
// check if any of the legacy tags
isLegacy: dbName === DatabaseName.POSTGRES_LEGACY,
isMongodb: dbName === DatabaseName.MONGODB, isMongodb: dbName === DatabaseName.MONGODB,
isMSSQL: dbName === DatabaseName.SQL_SERVER, isMSSQL: dbName === DatabaseName.SQL_SERVER,
isOracle: dbName === DatabaseName.ORACLE, isOracle: dbName === DatabaseName.ORACLE,