docs/1.18/prisma-client/setup/constructor-GO-go02.mdx
import Collapse from "components/Markdown/Collapse" import Code from "components/Markdown/Code" import Warning from "components/Markdown/Warning"
export const meta = { title: 'Constructor (Go)', position: 30, technology: 'go', technologyOrder: 3, articleGroup: 'Constructor', }
The Prisma constructor is used to create new instances of the Prisma client.
New(options PrismaOptions) Client
PrismaOptions has the following properties (all are optional):
endpoint: string: The endpoint of your Prisma service. If not provided, the Client will default to the endpoint that was specified in prisma.yml when the Client was generated.debug: boolean: If set to true, each invokation of a method on the Prisma client will print the GraphQL query that is sent to the Prisma API to the console. Default: false.Use default values for endpoint and secret that were specified in prisma.yml when the Client was generated:
db := prisma.New(nil)
Override default values for endpoint and secret that had been specified in prisma.yml when the Client was generated:
client := prisma.New(&prisma.PrismaOptions{
Endpoint: "http://localhost:4466/hello-world/dev",
Debug: true,
})