Skip to content

Releases: datastax/astra-db-ts

v2.0.0-preview.5

06 Feb 17:56
Compare
Choose a tag to compare
v2.0.0-preview.5 Pre-release
Pre-release

v2.0.0-preview.4

05 Feb 15:46
Compare
Choose a tag to compare
v2.0.0-preview.4 Pre-release
Pre-release
  • ESM support & various other compat improvements (#100) caf28e7
  • Docs work + update internal parsing & tooling (#99) 30fb76f

v2.0.0-preview.3...v2.0.0-preview.4

v2.0.0-preview.3

28 Jan 16:48
Compare
Choose a tag to compare
v2.0.0-preview.3 Pre-release
Pre-release

v2.0.0-preview.2

23 Jan 02:08
Compare
Choose a tag to compare
v2.0.0-preview.2 Pre-release
Pre-release
  • fix for process.env in the browser 7517a12

v2.0.0-preview.1...v2.0.0-preview.2

v2.0.0-preview.1

21 Jan 16:26
Compare
Choose a tag to compare
v2.0.0-preview.1 Pre-release
Pre-release
  • remoaved feature-flag tables header 23245c2
  • begrudgingly added InetAddress back as DataAPIInet 6aa0594
  • DataAPIDuration massive overhaul 4ea6a97
  • work for repl scirpt 98a9e66
  • overhaul of times 9d087f2
  • overhaul of dates ce54e01
  • enhanced coll bignumbers support cbcc101
  • reexport from version file 4b86423
  • check for broken compilation when skipLibCheck: false w/ astra-db-ts as dep a8dfc4f
  • bigints & counters now use bigint 29e5805
  • killed DataAPITimestamp 344b10a
  • proper checking for Bignumbers eea4db0
  • separate scripts/check.sh file for typechecking/linting 3fc4f33
  • UnexpectedDataAPIResponseError e1c342f
  • ser-des work (#92) 60e616f
  • Expand UUID versions (#91) 04af5e3

v2.0.0-preview.0...v2.0.0-preview.1

v2.0.0-preview.0

11 Dec 14:42
Compare
Choose a tag to compare
v2.0.0-preview.0 Pre-release
Pre-release

NOTE
The release notes are still under construction
The current commit list is just temporary

v1.5.0...v2.0.0-preview.0

v1.5.0

20 Sep 21:43
Compare
Choose a tag to compare

Namespace deprecation (docs link)

  • The "namespace" terminology is now deprecated (still backwards compatible) everywhere
    • There is a new "keyspace" alternative for each parameter name or method with "namespace" in it
    • e.g. db.useNamespace(...) still works, but now prefer the db.useKeyspace(...) alternative
  • All usages of "namespace" will be removed in an upcoming major release

Other deprecations (to be removed in v2.0)

  • collection.bulkWrite() is now deprecated
    • Prefer to just manually call the functions yourself
  • db.collections() is also now deprecated
    • Equivalent to (await db.listCollections()).map(c => new Collection(c.name))

Misc improvements/fixes

  • collection.drop() will now work properly if the collection is in a non-default keyspace
    • Before, it would attempt to drop the collection from 'default_keyspace'
  • returnDocument on findOneAnd* functions are finally optional
    • Defaults to 'before' on the Data API
  • updateDbNamespace was changed to immediately set the new keyspace
    • Before, it would wait for the keyspace to be created first
      • This would lead to easier race conditions, and they keyspace wouldn't be set at all if creation errored
  • [Admin]CommandSucceededEvents now have a warnings field for any warnings the Data API may return
    • These may point out deprecated/incorrect practices, or any other issues that aren't strictly an error.
    • (e.g. using the now-deprecated (create|find|drop)Namespace admin commands on DSE/HCD)
  • Added missing DB statuses to the DatabaseStatus enum (e.g. 'HIBERNATED' and 'HIBERNATING')
    • You can check the diff here
  • Better error for if the Admin classes don't have a token set
    • (for the astra variants)
  • Various error message improvements throughout the client
    • Fixed some errors being obfuscated, improved the clarity of a few, added ' (+ more <num_errors> errors)' to the end of aggregated errors
  • Exposed FetchH2 and FetchNative fetchers to make it easier to wrap them with your own for customization purposes
    • For use with setting a 'custom' client
  • Exposed DEFAULT_KEYSPACE constant

Internal stuff

(Too many changes to list in detail, but here are the highlights)
  • MAJOR overhaul of test suite
    • Massively parallelized tests (full test suite used to take over 50 min to run.. now it barely takes 10 minutes!)
    • Majorly improved test filtering through custom filtering functionality
    • Custom test report file generated to store full errors thrown during tests
    • Test suite sets up and cleans up after itself much better now (tests much more reproducible now)
    • Custom test script CLI to make running tests super easy
    • Vectorize tests wait for providers to warm up now instead of erroring out after the first try
    • Much more info here
  • Updated ESLint + config
    • Including adding rules to add all missing semicolons/commas
  • shell.nix + nix-direnv
    • Setups up shell env w/ nodejs_20, jq, and the astra CLI
    • Also adds the scripts dir to PATH
  • repl.sh script
    • Much easier way to quickly test out astra-db-ts functionality
    • Added -light option to build script to set up REPL quicker
      • Doesn't typecheck or do any extraneous code transformations (such as stripping comments)
  • returnDocumentResponses implementation

v1.4.1...v1.5.0

v1.4.1

24 Jul 17:09
Compare
Choose a tag to compare

Minor findEmbeddingProviders typing update

  • Split EmbeddingProviderParameterInfo into two separate types:
    • EmbeddingProviderProviderParameterInfo
    • EmbeddingProviderModelParameterInfo
  • Added .displayName and .hint to EmbeddingProviderProviderParameterInfo

v1.4.0...v1.4.1

v1.4.0

11 Jul 04:23
Compare
Choose a tag to compare

Db namespaces update

  • Db namespace is now undefined by default for non-Astra backends if unset
    • Still defaults to 'default_keyspace' for Astra usage
    • Will error out if attempting to perform an operation that requires a namespace
  • db.useNamespace('<namespace>')
    • Switches the current working namespace
    • Does not affect collections previously spawned from the Db using the old namespace
  • dbAdmin.createNamespace('<namespace>', { updateDbNamespace: true })
    • New idiom for working with namespaces right after creating them
    • Sets the DbAdmin's parent Db's namespace to the newly created one
    • See examples/non-astra-backends for an example

findEmbeddingProviders

  • dbAdmin.findEmbeddingProviders()
    • Provides in-depth, structured information about all of the available embedding providers supported on the working database
    • Output may vary slightly depending on the cloud-provider/region

EmbeddingHeadersProvider

  • All embeddingApiKey parameters now take in string | EmbeddingHeadersProvider | undefined
    • Two default token providers
      • AWSEmbeddingHeadersProvider for bedrock vectorization
      • EmbeddingAPIKeyHeaderProvider for symmetry (unit implementation)
    • New EmbeddingHeadersProvider subclasses may be created, additionally providing "token refreshing logic" as necessary
    • Fully backwards compatible—string API keys can still be passed in like normal

Misc improvements

  • Better private field encapsulation for the main classes (Collection, Db, etc.)
    • private get _httpClient() escape hatch present if necessary
  • Authentication failure errors are no longer intercepted/wrapped by the client
    • Now shows the raw error straight from the Data API
    • Root cause of error should be a bit less obfuscated now
  • TokenProvider doesn't have to return a Promise anymore
    • Like the new EmbeddingHeadersProvider, it can now return string | nullish | Promise<string | nullish>
    • Avoids the slight performance penalty of awaiting a Promise if one isn't returned anymore
  • Further documentation fixes/tweaks (especially around vectorize)

v1.3.0...v1.4.0

v1.3.0

22 Jun 07:13
Compare
Choose a tag to compare

Non-Astra backend support

  • New environment parameter on DataAPIClient and db.admin()
    • Accepts 'astra' | 'dse' | 'hcd' | 'cassandra' | 'other'
    • Defaults to 'astra'
  • All token parameters now take in string | TokenProvider | undefined
    • Two default token providers
      • UsernamePasswordTokenProvider for DSE, HCD
      • StaticTokenProvider for symmetry (unit implementation)
    • New TokenProvider subclasses may be created, additionally providing "token refreshing logic" as necessary
    • Tokens are now "optional" (i.e. you won't see a "missing token error" until the server throws one on an API request)
  • New DataAPIDbAdmin for namespace CRUD on non-Astra instances
  • New example in examples/ for running on non-astra

Cursor sort vectors

  • New includeSortVector parameter on cursor
    • False by default
    • If set to true, fetches the $vector used in the cursor's vector sort (if applicable)
  • New await cursor.getSortVector() to get the sort vector if the above is set

Deprecations

  • vector/vectorize keyword parameters deprecated on document operations
    • Use raw $vector[ize] in documents for inserts
    • Use sort: { $vector[ize]: ... } for sorts
  • deleteAll() deprecated in favor of deleteMany({})
    • deleteMany({}) actually works now

Misc improvements

  • Package size made 33% smaller
  • collection.distinct() made much faster when "distincting" on objects
  • Some documentation fixes/tweaks (especially around vectorize)
  • Few improved error messages

v1.2.1...v1.3.0