edgedb-js icon indicating copy to clipboard operation
edgedb-js copied to clipboard

Support changing Session within a Transaction

Open CarsonF opened this issue 1 year ago • 3 comments

Add binding support for https://github.com/edgedb/edgedb/pull/7187

client..transaction((tx) => {
  tx.withGlobals({ foo: 'bar' });
});

How should/can this be limited to only 4.8/5.0+ instances?

CarsonF avatar May 01 '24 14:05 CarsonF

How should/can this be limited to only 4.8/5.0+ instances?

IMO, on earlier versions we continue to silently fail, which is exactly as bad as the current state.

scotttrinh avatar May 01 '24 14:05 scotttrinh

IMO, on earlier versions we continue to silently fail, which is exactly as bad as the current state.

Well it was only a silent failure for me before because I was patching into the driver internals. Official types simply did not allow this.

CarsonF avatar May 01 '24 15:05 CarsonF

Then I think it's fine to allow it in the types but have it not work on versions that do not support this. This is runtime-only information that I don't think makes sense to contort ourselves into making a compile-time error however nice that would be for consumers 😅

scotttrinh avatar May 01 '24 15:05 scotttrinh