Skip to content

Issues integrating into existing Microsoft SQL database #724

@levipro

Description

@levipro

Description and expected behavior
We have an SQL database with many existing tables. I ran the following commands:

prisma db pull
zenstack init

Both of these had no issues. Next I ran:

zenstack generate

There were a few issues with this:

  1. Invalid zmodel generated from prisma schema:

Attribute "@default" doesn't have a parameter named "map"

CreatedDate               DateTime                    @default(now(), map: "DF_Address_CreatedDate") @db.DateTime

Value is not assignable to parameter [Max]

NVarChar(Max)
VarChar(Max)

So to resolve these I manually removed , map: "DF_Address_CreatedDate" and then replaced Max with a number just to test.

  1. After that I received the error Maximum call stack size exceeded

To get this to work I had to pass --stack-size=2048 --max-old-space-size=12288 to node

Environment (please complete the following information):

  • ZenStack version: 1.0.0-beta.24
  • Prisma version: 5.3.1
  • Database type: Microsoft SQL

Additional Details

I have enabled the trpc plugin

plugin trpc {
  provider = '@zenstackhq/trpc'
  output = 'src/server/routers/generated'
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions