valtyr/prisma-kysely

SQL Server Support?

Closed this issue · 4 comments

@valtyr would this library support interpreting Prisma SQL Server Schemas? I am implementing a custom kysely dialect and wanted to check to see if I could use this library

dylel commented

I've tried using sql server, for some reason this doesn't seem to be supported. I just get

spawn prisma-kysely ENOENT

Not sure why this needs to be dialect specific, shouldn't this just look at the types?

valtyr commented

Hey there, the types are different for each driver. I'm all for supporting SQL Server, we just need to provide a type map for the dialect.

It should be enough to add a type map in the generateFieldType file (https://github.com/valtyr/prisma-kysely/blob/main/src/helpers/generateFieldType.ts) and add SQLServer as a valid option in the config validator (https://github.com/valtyr/prisma-kysely/blob/main/src/utils/validateConfig.ts). If you were willing to submit a PR that would be awesome.

valtyr commented

Let me know you run into any issues or if I can be of any help @BStoller

dylel commented

I've submitted a pr #68 for this change, honestly a little unsure on the type mapping but seems good