Skip to content

Commit

Permalink
fix: post merge
Browse files Browse the repository at this point in the history
  • Loading branch information
fbaldi6 committed Dec 19, 2024
1 parent 11b5eda commit 0fdae42
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 233 deletions.
240 changes: 70 additions & 170 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/driver/spanner/SpannerDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ export class SpannerDriver implements Driver {
*/
async connect(): Promise<void> {
this.instance = this.spanner.instance(this.options.instanceId)
this.instanceDatabase = this.instance.database(this.options.databaseId, this.options.sessionPool ?? {})
this.instanceDatabase = this.instance.database(
this.options.databaseId,
this.options.sessionPool ?? {},
)
}

/**
Expand Down
24 changes: 12 additions & 12 deletions src/driver/spanner/SpannerSessionPoolOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
* more: https://github.com/ko3a4ok/nodejs-spanner/blob/aa8e8becf74d41d0de68253c17ebab188b5c7620/src/session-pool.ts#L149
*/
export interface SpannerSessionPoolOptions {
acquireTimeout?: number;
concurrency?: number;
fail?: boolean;
idlesAfter?: number;
keepAlive?: number;
labels?: { [label: string]: string };
max?: number;
maxIdle?: number;
min?: number;
acquireTimeout?: number
concurrency?: number
fail?: boolean
idlesAfter?: number
keepAlive?: number
labels?: { [label: string]: string }
max?: number
maxIdle?: number
min?: number
/**
* @deprecated. Starting from v6.5.0 the same session can be reused for
* different types of transactions.
*/
writes?: number;
incStep?: number;
databaseRole?: string | null;
writes?: number
incStep?: number
databaseRole?: string | null
}
/* Defaults:
const DEFAULTS: SessionPoolOptions = {
Expand Down
2 changes: 1 addition & 1 deletion src/entity-manager/MongoEntityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ export class MongoEntityManager extends EntityManager {
) || {}
if (id) {
query["_id"] =
id instanceof objectIdInstance ? id : new ObjectId(id)
id instanceof objectIdInstance ? id : new objectIdInstance(id)
}
const cursor = this.createEntityCursor<Entity>(entityClassOrName, query)
const deleteDateColumn =
Expand Down
10 changes: 6 additions & 4 deletions src/migration/MigrationExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,11 @@ export class MigrationExecutor {
.migrationId,
}),
isGenerated: true,
generationStrategy: this.connection.driver.options.type === "spanner"
? "uuid"
: "increment",
generationStrategy:
this.connection.driver.options.type ===
"spanner"
? "uuid"
: "increment",
isPrimary: true,
isNullable: false,
},
Expand Down Expand Up @@ -670,7 +672,7 @@ export class MigrationExecutor {
values["name"] = migration.name
}

if(this.connection.driver.options.type === "spanner"){
if (this.connection.driver.options.type === "spanner") {
// Spanner cannot auto-generate the id, so we need to provide it
values["id"] = uuidv4()
}
Expand Down
3 changes: 2 additions & 1 deletion src/persistence/SubjectExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ export class SubjectExecutor {
* Updates all given subjects in the database.
*/
protected async executeUpdateOperations(): Promise<void> {
const isSpanner = this.queryRunner.connection.driver.options.type === "spanner"
const isSpanner =
this.queryRunner.connection.driver.options.type === "spanner"
const updateSubject = async (subject: Subject) => {
if (!subject.identifier)
throw new SubjectWithoutIdentifierError(subject)
Expand Down
14 changes: 0 additions & 14 deletions src/query-builder/QueryBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -837,20 +837,6 @@ export abstract class QueryBuilder<Entity extends ObjectLiteral> {
return ""
}

/**
* Time travel queries for CockroachDB
*/
protected createTimeTravelQuery(): string {
if (
this.expressionMap.queryType === "select" &&
this.expressionMap.timeTravel
) {
return ` AS OF SYSTEM TIME ${this.expressionMap.timeTravel}`
}

return ""
}

/**
* Creates "WHERE" expression.
*/
Expand Down

This file was deleted.

0 comments on commit 0fdae42

Please sign in to comment.