Scalar list operations, docs improvements, minor fixes
🌟 **Help us spread the word about Prisma by starring the repo ☝️ or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20Prisma%20Go%20Client%20release%20v0.12.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma-client-go/releases/tag/v0.12.0) about the release.**
Major changes
You can now filter and atomically update scalar lists with Prisma Client Go.
Given the following Prisma schema:
prisma
model User {
id Int id default(autoincrement())
name String
pets String[]
}
You can filter pets with the following code:
go
user, err := client.User.FindFirst(
db.User.Pets.HasSome([]string{"Fido", "Scooby"}),
).Exec(ctx)
And when you add a new furry addition to your family, you can update your list with `Push`:
go
user, err := client.User.FindUnique(
db.User.Name.Equals(1),
).Update(
db.User.Items.Push([]string{"Charlemagne"}),
).Exec(ctx)
Learn more about how to use this new feature in [our documentation](https://github.com/prisma/prisma-client-go/blob/main/docs/reference/12-scalar-lists.md). To dive deeper into the concept of scalar lists, you can read the guide on [Working with scalar lists](https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-scalar-lists-arrays).
Changes
* refactor(engine): add qe.go (595) steebchen
* refactor(generator): group binary related code (596) steebchen
* refactor(generator): extract template and binary functions (597) steebchen
* ci(test): introduce e2e tests (599) steebchen
* docs: fix migration command (601) s-takehana
* docs: fix example code (607) s-takehana
* docs(find): fix example code (609) s-takehana
* docs(fetch): fix example code (614) s-takehana
* docs(introduction): fix example code (613) s-takehana
* docs(filters): fix example code (612) s-takehana
* refactor(ast): pick from many input type names (617) steebchen
* docs(pagination): fix example code (619) s-takehana
* docs(create): fix example code (621) s-takehana
* docs(order-by): fix example code (620) s-takehana
* feat(ast): add list read and write filters (618) steebchen
* docs: use `SortOrderAsc`/`SortOrderDesc` (622) s-takehana
* docs(update): fix example code (623) s-takehana
* docs(upsert): fix example code (625) s-takehana
* docs(delete): fix example code (624) s-takehana
* docs(relations): fix example code (626) s-takehana
* docs(transactions): fix example code (628) s-takehana
* docs(raw): fix example code (627) s-takehana
* docs(json): fix example code (630) s-takehana
* docs(if-present-methods): fix example code (631) s-takehana
* fix(templates): redundant type (633) s-takehana
* docs(limitations): fix link (632) s-takehana
* feat(engine): fail when client is disconnected (634) steebchen
* docs(reference): add scalar list docs (635) steebchen
* docs(reference): update scalar lists docs (636) steebchen
* fix(logger): microsecond resolution (638) s-takehana
* feat(prisma): upgrade prisma to 3.3.0 (642) steebchen
Contributors
s-takehana and steebchen
Special shoutout to s-takehana for all the useful PRs :)
Interested in providing feedback for the Go client?
We would like to ask you a few questions and get your feedback about the Go client. We'll send merch along your away as a thank you.
If you're interested, email me at steebprisma.io or join our [public Slack](https://slack.prisma.io) and DM me.