-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SafeQL (libpg-query) is not compatible with GLIBC > 2.34 #196
Comments
|
@Newbie012 thanks for replying, |
That's odd. It seems to work on my end when I pull your changes. It looks like ESLint is unable to retrieve the generated results from SafeQL's generator. Could you please:
import { createGenerator } from '@ts-safeql/generate'
import { parseQuerySync } from 'libpg-query'
import postgres from 'postgres'
async function run (query: string): Promise<void> {
const sql = postgres({ user: 'postgres', password: 'postgres', database: 'safeql_prisma_demo' })
const generator = createGenerator()
console.log('✅ generator created')
const parsed = parseQuerySync(query)
console.log('✅ query parsed')
const result = await generator.generate({
cacheKey: 'test',
fieldTransform: undefined,
pgParsed: parsed,
query,
sql,
cacheMetadata: false,
nullAsOptional: false,
nullAsUndefined: false,
overrides: undefined
})
console.log('✅ query generated')
console.log(JSON.stringify(result, null, 2))
await sql.end()
}
void run('SELECT * FROM "Post"')
|
@Newbie012 this is the output I'm getting warning package.json: No license field |
Okay, so it seems like the generator is working okay. It's probably the worker that bridges them. Since ESLint doesn't allow "async" rules, SafeQL uses synckit to perform async work synchronously. Behind the scenes, it does two things:
I want to check if the issue is somewhat related to + "databaseUrl": "postgresql://postgres:postgres@localhost:5432/safeql_prisma_demo"
- "migrationsDir": "./prisma/migrations", and then re-run eslint? |
@Newbie012 After doing the above mentioned change , I get these results: Also I'm not getting any lint errors in my VSC, it's only when I run the command then I can see the errors |
The reason why creating the shadow database ( |
migrationsDir
@Newbie012 I'm getting this error in the VS code output tab |
Your OS has issues running the compiled |
@Newbie012 I had already tried that but still getting the error, The error says "GLIBC 2.34 not found" but my system has "(Ubuntu GLIBC 2.35-0ubuntu3.5) 2.35" |
Oh, I see. It seems like Edit - launchql/libpg-query-node#39 |
@Newbie012 thanks for the help, Could please put the link of the opened issue in the chat |
migrationsDir
@Newbie012 It seems there is no activity on the linked issue, can you try some other workaround for this? |
I think the glibc problem has been fixed in Wonder if the precompiled binaries for Node.js 20.x for linux/amd64, linux/arm64, darwin/arm64 work around this for now: |
@karlhorky we're waiting for |
@xegulon correct, I think a new release of |
@karlhorky thanks for your answer! Is there something blocking for the binary to be built? Can't wait to use SafeQL on my current project 😄 |
Submitted a PR to fix the issue (at least on Linux, tested on Fedora Linux 39) : launchql/libpg-query-node#40 |
Seems like @wale's PR was merged and published, so this should be resolved now with (note: the Copying the comment here for completeness:
|
@Newbie012 I'm still getting the same error Failed to load plugin '@ts-safeql/eslint-plugin' declared in '.eslintrc.json': /snap/core20/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found I have added "libpg-query": "16.0.1" @wale @xegulon @karlhorky Is the issue resolved for you guys?? |
I can confirm that it has been tested and resolved. This might be due to |
@wale can you run this example https://github.com/developer-vtnetzwelt/safeql-prisma-demo and check if everything is working fine. I have glibc_2.35 installed, I want to run the safeql against the prisma migration file and not with database url |
The install works well with the latest version, which is good. I setup the instructions according to prisma docs with eslint, and I modified some of my queries to add errors, but I do not see warnings yet. I'll inspect later! |
You need to explicitly install |
@wale I have installed it already but still not working |
Due to how the versions in the This statement in your package.json will not work. |
@wale git code was not updated, i have updated it now , please check now |
You need a database URL so SafeQL can infer metadata and understand the database structure, otherwise the URL falls back to a default value, see the relevant documentation. You can see it's asking for a That's because it falls back to the connection URL of |
@developer-vtnetzwelt @Newbie012 now that this issue has been confirmed to be resolved, can this issue be closed? |
I believe so. @developer-vtnetzwelt can you test it with the latest version of libpg-query? |
I'll close this issue for now. |
Describe the bug
I'm trying to use safeql in a new project along side prisma but I'm not getting any lint errors, it doesn't seem to be working
To Reproduce
I have put a small sample example in this repo https://github.com/developer-vtnetzwelt/safeql-prisma-demo , I have written a wrong SQL query in the main file but when I run "npm run build", I'm not getting any errors
Expected behavior
It should give me an error that column "iddss" does not exist
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: