Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: temporally point to our spanner fork #16

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ const firstUser = await User.findOneBy({
})
const timber = await User.findOneBy({
firstName: "Timber",
lastName: "Saw"
lastName: "Saw",
})

await timber.remove()
Expand Down Expand Up @@ -222,7 +222,7 @@ await timber.remove()
- for **Google Cloud Spanner**

```
npm install @google-cloud/spanner --save
npm install @streamyard/spanner --save
```

Provide authentication credentials to your application code
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@streamyard/typeorm",
"private": true,
"version": "0.3.16-5-beta2",
"version": "0.3.16-5-beta3",
"description": "Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB, Spanner databases.",
"license": "MIT",
"readmeFilename": "README.md",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/InitCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ Steps to run this project:
packageJson.dependencies["mongodb"] = "^5.2.0"
break
case "spanner":
packageJson.dependencies["@google-cloud/spanner"] = "^5.18.0"
packageJson.dependencies["@streamyard/spanner"] = "^5.18.0"
break
}

Expand Down
4 changes: 2 additions & 2 deletions src/driver/spanner/SpannerConnectionOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import { SpannerSessionPoolOptions } from "./SpannerSessionPoolOptions"
*/
export interface SpannerConnectionOptions
extends BaseConnectionOptions,
SpannerConnectionCredentialsOptions {
SpannerConnectionCredentialsOptions {
/**
* Database type.
*/
readonly type: "spanner"

/**
* The driver object
* This defaults to require("@google-cloud/spanner").
* This defaults to require("@streamyard/spanner").
*/
readonly driver?: any

Expand Down
13 changes: 8 additions & 5 deletions src/driver/spanner/SpannerDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,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 Expand Up @@ -422,9 +425,9 @@ export class SpannerDriver implements Driver {
if (value === null || value === undefined)
return columnMetadata.transformer
? ApplyValueTransformers.transformFrom(
columnMetadata.transformer,
value,
)
columnMetadata.transformer,
value,
)
: value

if (columnMetadata.type === Boolean || columnMetadata.type === "bool") {
Expand Down Expand Up @@ -737,7 +740,7 @@ export class SpannerDriver implements Driver {
console.error(e)
throw new DriverPackageNotInstalledError(
"Spanner",
"@google-cloud/spanner",
"@streamyard/spanner",
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/platform/PlatformTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class PlatformTools {
* spanner
*/
case "spanner":
return require("@google-cloud/spanner")
return require("@streamyard/spanner")

/**
* mongodb
Expand Down
Loading