Skip to content

Releases: geldata/gel-js

@gel/generate v0.7.0

23 Oct 19:03
e0ff26b

Choose a tag to compare

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

gel-js v2.1.1

27 Jun 19:55
be91c70

Choose a tag to compare

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

@gel/generate v0.6.4

27 Jun 19:53
be91c70

Choose a tag to compare

What's Changed

  • Fix handling of inserts with both unless conflict and a with block by @jaclarke in #1291
  • Stabilize queries generated object typedefs by @scotttrinh in #1298

@gel/generate v0.6.3

16 May 18:33
d47fd12

Choose a tag to compare

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

29 Apr 16:31
bf985ea

Choose a tag to compare

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 isolation and readonly will now affect the implicit transaction that every query run with this client uses. You can use this to set a read-only client with RepeatableRead isolation like:
export readonlyClient = createClient()
  .withTransactionOptions({
    isolation: IsolationLevel.RepeatableRead,
    readonly: true,
  });

What's Changed

@gel/ai v0.1.2

11 Apr 15:21
f431f38

Choose a tag to compare

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

New Contributors

Full Changelog: ai-v0.1.1...ai-v0.1.2

v2.0.2

04 Apr 19:18
e151af6

Choose a tag to compare

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/Execute methods used by UI by @jaclarke in #1241
  • Adjust default warning handlers for DX by @CarsonF in #1240
  • Expose query capabilities in client.describe() and analyzeQuery by @elprans in #1247

@gel/ai v0.1.1

04 Apr 19:13
e151af6

Choose a tag to compare

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

05 Mar 01:41
deb74d4

Choose a tag to compare

What's Changed

  • Update reflection queries types to have more strict types asserting that they return non-empty arrays.

@gel/generate v0.6.2

05 Mar 02:01
aad5627

Choose a tag to compare

What's changed

  • Bump the peer dependency on the driver to get the new types