diff --git a/packages/backend-core/src/sql/sql.ts b/packages/backend-core/src/sql/sql.ts index bb3133f852..ebae09e156 100644 --- a/packages/backend-core/src/sql/sql.ts +++ b/packages/backend-core/src/sql/sql.ts @@ -700,6 +700,8 @@ class InternalBuilder { const direction = value.direction === SortOrder.ASCENDING ? "asc" : "desc" + // TODO: figure out a way to remove this conditional, not relying on + // the defaults of each datastore. let nulls: "first" | "last" | undefined = undefined if ( this.client === SqlClient.POSTGRES || diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index 9f0a9e6269..d8c2a4a257 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -1596,9 +1596,6 @@ describe.each([ // Our bigints are int64s in most datasources. let BIG = "9223372036854775807" - if (name === DatabaseName.ORACLE) { - // BIG = "9223372036854775808" - } beforeAll(async () => { table = await createTable({ diff --git a/packages/server/src/integrations/oracle.ts b/packages/server/src/integrations/oracle.ts index 6139b18844..fcbc0731ea 100644 --- a/packages/server/src/integrations/oracle.ts +++ b/packages/server/src/integrations/oracle.ts @@ -506,6 +506,13 @@ class OracleIntegration extends Sql implements DatasourcePlus { password: this.config.password, connectString, } + + // We set the timezone of the connection to match the timezone of the + // Budibase server, this is because several column types (e.g. time-only + // timestamps) do not store timezone information, so to avoid storing one + // time and getting a different one back we need to make sure the timezone + // of the server matches the timezone of the database. There's an assumption + // here that the server is running in the same timezone as the database. const tz = Intl.DateTimeFormat().resolvedOptions().timeZone const connection = await oracledb.getConnection(attributes) await connection.execute(`ALTER SESSION SET TIME_ZONE = '${tz}'`)