Fix dates and times for good? maybe?
This commit is contained in:
parent
c6ec710abe
commit
aa7894604f
|
@ -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)
|
||||
|
|
|
@ -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<any[]> {
|
||||
|
|
|
@ -318,9 +318,15 @@ export async function outputProcessing<T extends Row[] | Row>(
|
|||
} 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}`
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue