diff --git a/packages/backend-core/src/sql/sql.ts b/packages/backend-core/src/sql/sql.ts index a06af6e318..e41d744812 100644 --- a/packages/backend-core/src/sql/sql.ts +++ b/packages/backend-core/src/sql/sql.ts @@ -666,19 +666,16 @@ class InternalBuilder { let nulls: "first" | "last" | undefined = undefined if ( - this.client === SqlClient.ORACLE || - this.client === SqlClient.POSTGRES + this.client === SqlClient.POSTGRES || + this.client === SqlClient.ORACLE ) { nulls = value.direction === SortOrder.ASCENDING ? "first" : "last" } let composite = `${aliased}.${key}` if (this.client === SqlClient.ORACLE) { - query = query.orderBy( - // @ts-ignore - this.knex.raw(this.convertClobs(composite)), - direction, - nulls + query = query.orderByRaw( + `${this.convertClobs(composite)} ${direction} nulls ${nulls}` ) } else { query = query.orderBy(composite, direction, nulls) diff --git a/packages/server/src/integrations/oracle.ts b/packages/server/src/integrations/oracle.ts index a9ce05302c..41762576dd 100644 --- a/packages/server/src/integrations/oracle.ts +++ b/packages/server/src/integrations/oracle.ts @@ -406,9 +406,7 @@ class OracleIntegration extends Sql implements DatasourcePlus { password: this.config.password, connectString, } - const connection = await oracledb.getConnection(attributes) - await connection.execute(`ALTER SESSION SET TIME_ZONE='UTC'`) - return connection + return await oracledb.getConnection(attributes) } async create(query: SqlQuery | string): Promise { diff --git a/packages/server/src/utilities/rowProcessor/index.ts b/packages/server/src/utilities/rowProcessor/index.ts index 139f3a5b8d..62a3b2dd74 100644 --- a/packages/server/src/utilities/rowProcessor/index.ts +++ b/packages/server/src/utilities/rowProcessor/index.ts @@ -318,9 +318,15 @@ export async function outputProcessing( } else if (column.type === FieldType.DATETIME && column.timeOnly) { for (let row of enriched) { if (row[property] instanceof Date) { - const hours = row[property].getHours().toString().padStart(2, "0") - const minutes = row[property].getMinutes().toString().padStart(2, "0") - const seconds = row[property].getSeconds().toString().padStart(2, "0") + const hours = row[property].getUTCHours().toString().padStart(2, "0") + const minutes = row[property] + .getUTCMinutes() + .toString() + .padStart(2, "0") + const seconds = row[property] + .getUTCSeconds() + .toString() + .padStart(2, "0") row[property] = `${hours}:${minutes}:${seconds}` } }