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: allow host in dsn and use statement based transactions #10

Merged
merged 13 commits into from
Aug 2, 2021
Merged
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
gorm/
gorm/
.idea
26 changes: 3 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,36 +73,16 @@ $ export SPANNER_EMULATOR_HOST=localhost:9010

## Troubleshooting

This driver shouldn't automatically retry the transactions but it does.
It causes unwanted results. Don't use this library in production yet.
The driver will propagate any Aborted error that is returned by Cloud Spanner
during a read/write transaction, and it will currently not automatically retry
the transaction.

---

gorm cannot use the driver as it-is but @rakyll has been working on a dialect.
She doesn't have bandwidth to ship a fully featured dialect right now but contact
her if you would like to contribute.

---

`error = <use T(nil), not nil>`: Use a typed nil, instead of just nil.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer a problem. Untyped nil parameters are now supported.


The following query returns rows with NULL likes:

``` go
var nilInt64 *int64
db.QueryContext(ctx, "SELECT id, text FROM tweets WHERE likes = @likes LIMIT 10", nilInt64)
```

---

When querying and executing with emails, pass them as arguments and don't hardcode
them in the query:

``` go
db.QueryContext(ctx, "SELECT id, name ... WHERE email = @email", "jbd@google.com")
```

The driver will relax this requirement in the future but it is a work-in-progress for now.

---

Expand Down
Loading