Releases: geldata/gel-js
@gel/generate v0.7.0
Selective Query Generation with Patterns
The queries generator now supports glob patterns as positional arguments, letting you selectively regenerate only the query files you need instead of processing your entire project. When working with large codebases, you can target specific directories or patterns like npx @edgedb/generate queries "src/user/**/*.edgeql" or process multiple locations at once with npx @gel/generate queries "critical/**.edgeql" "admin/*.edgeql". This is a boon when you might have multiple sub-folders that contain .edgeql files, or if the default file detection is picking up more files than you'd like.
# Only regenerate user-related queries
npx @gel/generate queries "**/*user*.edgeql"
# Regenerate queries from multiple specific directories
npx @gel/generate queries "src/queries/" "admin/queries/"Advanced TypeScript Types for Custom Scalars
The new --use-resolved-codec-type flag enables using advanced TypeScript type system features like branded types, template literal types, and union types for custom scalars. This is especially valuable when you have abstract scalars with regex constraints that map to template literal types (e.g., scalar type Email extending str { constraint regexp(...) } → `${string}@${string}.${string}`), or when you want to use branded types for domain modeling (e.g., type UserId = string & { __brand: "UserId" }). While this doesn't change runtime decoding behavior, it provides stronger compile-time guarantees by letting you declare precise TypeScript types via module augmentation of the OverrideCodecType interface.
# Generate with customizable scalar types
npx @gel/generate queries --use-resolved-codec-type// Then augment in your code for compile-time type safety:
declare module "gel" {
interface OverrideCodecType {
"default::Email": `${string}@${string}.${string}`; // Template literal type
"default::UserId": string & { __brand: "UserId" }; // Branded type
}
}What's Changed
- Add positional pattern support for gel generate queries by @nervetattoo in #1308
- Make clear the implications of generated typescript queryfiles by @jackfischer in #1310
- feat: allow users to customize the TypeScript type of a custom scalar by @freeatnet in #1313
New Contributors
- @nervetattoo made their first contribution in #1308
- @jackfischer made their first contribution in #1310
gel-js v2.1.1
Mostly this is a supporting version change to update the reflection functionality that powers the @gel/generate queries code generator. Nothing fundamentally has changed in the driver itself, but the driver owns this functionality (for now).
What's Changed
- Stabilize
queriesgenerated object typedefs by @scotttrinh in #1298
@gel/generate v0.6.4
What's Changed
- Fix handling of inserts with both unless conflict and a with block by @jaclarke in #1291
- Stabilize
queriesgenerated object typedefs by @scotttrinh in #1298
@gel/generate v0.6.3
What's Changed
- Fix module names that are not valid identifiers by @scotttrinh in #1226
- Fix handling of assert_single wrapped select/update exprs when used as e.with expr by @jaclarke in #1266
- [QB] Optimize scalar cast maps by @CarsonF in #1268
- Fix type error when e.with() wraps unlessConflict() by @clarkg in #1279
New Contributors
v2.1.0
New features
PreferRepeatableRead
The main headline feature here is our new PreferRepeatableRead transaction option which will downgrade the transaction isolation from Serializable to RepeatableRead iff the server thinks the query is safe to downgrade. You can opt into this behavior by using withTransactionOptions:
export const client = createClient()
.withTransactionOptions({
isolation: IsolationLevel.PreferRepeatableRead,
});withTransactionOptions applies to implicit transactions as well
- Both
isolationandreadonlywill now affect the implicit transaction that every query run with this client uses. You can use this to set a read-only client withRepeatableReadisolation like:
export readonlyClient = createClient()
.withTransactionOptions({
isolation: IsolationLevel.RepeatableRead,
readonly: true,
});What's Changed
- Match CLI package logic to Python wrapper by @scotttrinh in #1260
- Export more types and classes from
gelpackage by @scotttrinh in #1262 - Add benchmark for query throughput by @scotttrinh in #1269
- Set default transaction options from
withTransactionOptionsby @scotttrinh in #1270 - Support
PreferRepeatableReadisolation level by @scotttrinh in #1271
@gel/ai v0.1.2
This is mostly a bug fix for a botched bug fix. 🎩 h/t to @Gobot1234 for helping and welcome to the contributors list! Added some integration tests for AI to hopefully catch these easy logic bugs in the future, and make it easier to add more tests in the future.
What's Changed
- Update
@gel/aiREADME for latest API by @scotttrinh in #1256 - Fix parsing bug in parseRagResponse by @Gobot1234 in #1257
- Add tests for
@gel/aiby @scotttrinh in #1264
New Contributors
- @Gobot1234 made their first contribution in #1257
Full Changelog: ai-v0.1.1...ai-v0.1.2
v2.0.2
Mostly fixes to the new "warnings" system: we were not properly parsing the error JSON, so the warnings did not contain the hint that allows us to pretty print errors. @CarsonF also jumped in and improved the default DX of the warnings, making the errors themselves a bit easier to follow.
- Type Options.withConfig by @CarsonF in #1228
- Fix warning attributes by @CarsonF in #1237
- Export WarningHandler type / Share options exports with browser index by @CarsonF in #1239
- Return query warnings from the
rawParse/Executemethods used by UI by @jaclarke in #1241 - Adjust default warning handlers for DX by @CarsonF in #1240
- Expose query capabilities in
client.describe()andanalyzeQueryby @elprans in #1247
@gel/ai v0.1.1
Mostly a compatibility fix: Gel 6.0 shipped with some breaking changes to both embeddings and rag endpoints, so we're properly handling the new structures.
v2.0.1
What's Changed
- Update reflection queries types to have more strict types asserting that they return non-empty arrays.
@gel/generate v0.6.2
What's changed
- Bump the peer dependency on the driver to get the new types