edgedb-js
edgedb-js copied to clipboard
Query builder: Type names that contain spaces generate invalid EdgeQL due to the type name missing backticks
- Deno client: v1.3.0
- EdgeDB Version: 3.1+3bb7030
- EdgeDB CLI Version: 3.4.0+97cad0e
- OS Version: MacOS
Steps to Reproduce:
- Schema
module default {
type `a Type` {
name:str;
}
-
deno run --allow-all --unstable https://deno.land/x/edgedb/generate.ts queries
-
Add deno.ts
import e from "./dbschema/edgeql-js/index.ts";
const client = edgedb.createClient();
const query = e.select(e["`a Type`"], () => ({ id: true }));
const result = await query.run(client);
await client.close();
- deno run --allow-all --unstable deno.ts
Error: Uncaught EdgeQLSyntaxError: Unexpected 'Type'
|
2 | __scope_0_defaultaType := DETACHED default::a Type
| ^^^^
const err = new errorType(message);
^
at RawConnection._parseErrorMessage (https://deno.land/x/[email protected]/_src/baseConn.ts:295:17)
at RawConnection._executeFlow (https://deno.land/x/[email protected]/_src/baseConn.ts:1132:24)
at eventLoopTick (ext:core/01_core.js:183:11)
at async RawConnection.fetch (https://deno.land/x/[email protected]/_src/baseConn.ts:1243:9)
at async ClientConnectionHolder.retryingFetch (https://deno.land/x/[email protected]/_src/baseClient.ts:177:18)
at async Client.query (https://deno.land/x/[email protected]/_src/baseClient.ts:594:14)
- Gives a property does not exists editor problem. Same error using ["a Type"], although this one does not give an problem.