Skip to content

Releases: datastax/astra-db-ts

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

v1.2.1

31 May 18:05
Compare
Choose a tag to compare

Extended "non-standard" environment support

  • Client will now try using fetch-h2 (by default) regardless of runtime/environment
    • Before, it only did this if the runtime were standard node
  • Client will now default to fetch if fetch-h2 doesn't work by default
    • This will only happen if httpOptions is not set at all in DataAPIClientOptions
  • Client accepts a new client: 'custom' type in httpOptions, allowing you to create your own component to make API calls for the client
  • You can now manually pass in the fetch-h2 module to use yourself if astra-db-ts is having issues importing the default one when your code is minified (see the README)
  • New examples/ folder which has some common examples of running astra-db-ts in a "non-standard" environment
    • Also updated the README to cover more cases as well

Faster insertMany

  • Default batch size of documents was updated to 50
    • Data API now supports up to 100, >50 generally gives diminishing returns, especially depending on document size
    • You can still do your own tweaking with the chunkSize parameter to find what's fastest for you if necessary

v1.2.0

22 May 07:07
Compare
Choose a tag to compare

Added support for vectorize

  • createCollection was updated w/ vectorize options

Non-standard runtime support

  • Non-node runtimes will now trigger default use of the native fetch API instead of fetch-h2 which gives access to extended HTTP/2 and HTTP/1.1 support
  • Extended HTTP/1.1 options

v1.1.0

24 Apr 04:03
Compare
Choose a tag to compare
  • Updated SomeId to allow null (#35) f0da2f9
  • added support for AstraAdmin.dbInfo (#34) 9b32edb
  • Added extended http1 options (in DataAPIClient) (#33) c73f0da
  • roughly added estimatedDocumentCount (#32) f6a37e9

v1.0.2...v1.1.0

v1.0.2

19 Apr 17:31
Compare
Choose a tag to compare

v1.0.1...v1.0.2

v1.0.1

16 Apr 07:04
Compare
Choose a tag to compare

1.0.1

  • Updated createCollection documentation to mention checkExists
  • Fixed ragstack detection formatting slightly to keep in-line w/ codebase
  • Added couple replaceOne tests
  • Marked some things as internal that weren't already
  • '*' support for projections

v1.0.0...v1.0.1

v1.0.0

11 Apr 07:38
Compare
Choose a tag to compare
  • Merge pull request #25 from datastax/signature-cleanup fe82a3e
  • updated readme examples slightly a88b5e8
  • some last-minute doc updates + error management fixes 2a3ac88
  • more documentation & last minute config changes e389fa5

v1.0.0-alpha.2...v1.0.0