prisma-client-go
prisma-client-go copied to clipboard
Feature: Generate column placeholders for the Raw() API
Currently the columns in the Raw API are not type-safe
client.
Raw("SELECT * FROM User WHERE id = ? AND email = ?", "id2", "email2").
Exec(ctx, &actual)
It'd be nice if you could do something this:
client.
Raw("SELECT * FROM " + users.Table + " WHERE " + users.ID + " = ? AND " + users.Email + " = ?", "id2", "email2").
Exec(ctx, &actual)
This way if your tables or columns ever change, your Raw queries will break.