kysely-org / kysely

A type-safe typescript SQL query builder
https://kysely.dev
MIT License
9.9k stars 249 forks source link

mssql recursive CTE support #960

Open popobobo512 opened 2 months ago

popobobo512 commented 2 months ago

Im using MSSQL and i am having a incorrect syntax error on my recursive CTE

Kysely playground

Error: stack: 'Error: Incorrect syntax near \'recursive_menu_tree\'.\n' + ' at RequestTokenHandler.onErrorMessage (webpack-internal:///(rsc)/./node_modules/tedious/lib/token/handler.js:287:21)\n' + ' at Readable.eval (webpack-internal:///(rsc)/./node_modules/tedious/lib/token/token-stream-parser.js:18:33)\n

igalklebanov commented 2 months ago

Hey 👋

According to this, I don't think we support recursive CTEs the way they're implemented on mssql.

You're getting a SQL error for what seems to be the recursive keyword - it's a postgres thing.