Event Name
CreatePrismaSchema
Event Parameters
The entities that will be generated as models in the Prisma schema and represent the table name. By default, this param value is the entities that the user sets in the UI (Amplication dashboard).
Represents the data source type of Prisma provider (PostgreSQL, MySQL, MongoDB, etc.). Show PrismaDataSource Type Definition
type PrismaDataSource = {
name : string ;
provider : DataSourceProvider ;
urlEnv : string ;
};
A generator determines which assets are created when you run the Prisma generate command. For more information: Prisma Generators . Show PrismaClientGenerator Type Definition
type PrismaClientGenerator = {
name : string ;
provider : string ;
urlEnv : string ;
};
const dataSource : PrismaDataSource = {
name: "mysql" ,
provider: "MySQL" ,
urlEnv: "DB_URL" ,
};
beforeCreatePrismaSchema (
context : DsgContext ,
eventParams : CreatePrismaSchemaParams
) {
return {
... eventParams ,
dataSource: dataSource ,
};
}
}
const CLIENT_GENERATOR : PrismaClientGenerator = {
name: "client" ,
provider: "prisma-client-js" ,
};