Releases: datastax/astra-db-ts
v2.0.2
Minor changes before 2.1.0
- Expose cursor page state
- Migrate
WithTimeout
to more generalCommandOptions
- findAvailableRegions implementation
- Fix bug making lexical options ignored in
createCollection
Note
See the https://github.com/datastax/astra-db-ts/releases/tag/v2.0.0 for the full release notes for the new 2.0.0
major version
v2.0.1
Minor bug patch release
Minor patch to fix findAnd*
commands not property deserializating the returned document
Note
See the https://github.com/datastax/astra-db-ts/releases/tag/v2.0.0 for the full release notes for the new 2.0.0
major version
v2.0.0
v2.0.0 - Major client overhaul
Warning
Release notes are still under construction
Table of contents
Note
Asterisks (*) by section names indicate those that include note of any breaking changes from v1.x to v2.x.
- What's new?
- Prerequisites*
- Data API tables support
findAndRerank
support- Overhaul of the logging system*
- Overhaul of the timeout system*
- Overhaul of cursors*
- Overhauls of certain admin functionality*
- Increased client compatibility across all environments*
- New fully-customizable ser/des system
- Errors improvements*
- Various minor changes and improvements
- Migration tips
What's new?
Prerequisites*
- Node.js v18 or higher
- TypeScript v5.0 or higher
Data API tables support
Adds complete support for Data API tables via the Table
class.
Dual types*
Classes/types such as UpdateOneOptions
, FindCursor
, InsertManyError
, etc. have been split into two different variants of each:
CollectionUpdateOneOptions
andTableUpdateOneOptions
,CollectionFind
andCursorTableFindCursor
,CollectionInsertManyError
andTableInsertManyError
,- etc.
Collection methods on the Db
class (such as db.collection()
, db.createCollection()
, db.listCollections()
, etc.) now have sister methods for tables:
db.table()
,db.createTable()
,db.listTables()
,- etc.
Indexes
Furthermore, tables necessitate indexes, which may be created through table.createIndex()
(and its sister methods), and dropped through db.dropTableIndex()
.
Utility types
New utility types to infer the table's TS-type from its schema has been added as well:
InferTableSchema
InferTablePrimaryKey
Datatypes
Lastly, of the major additions, new datatypes have been added as well to support the new tables:
DataAPIBlob
DataAPIDate
DataAPITime
DataAPIDuration
DataAPIInet
DataAPIVector
BigNumber
(re-exported frombignumber.js
)
See DATATYPES.md for more information on the new datatypes.
findAndRerank
support
Note
This is tied to the Overhaul of cursors section; please read that section as well for more information.
Preview hybrid search support has dropped via the collection.findAndRerank()
method, which uses a new FindAndRerankCursor
to iterate over its results.
New LexicalDoc
type added as well as a sister type to VectorDoc
and VectorizeDoc
.
Overhaul of the logging system*
The logging system has evolved beyond a simple, immutable monitorCommands
flag which would emit events only on the DataAPIClient
class.
Now, logging is configured through the logging
option anywhere along the options hierarchy, and adds a variety of new features:
- Events may log to the console as well now, as opposed to just being emitted as an event
- All classes in the client hierarchy are now event listeners
- These all extend the
HierarchicalLogger
class, which implements a minimal event emitter - Events are bubbled up from the class they were emitted from, all the way up to the root
DataAPIClient
- Event bubbling may be cancelled through
event.stop[Immediate]Propagation()
like the DOM
- These all extend the
Logging may also be enabled/disabled/reconfigured on the fly, via the .updateLoggingConfig(<config>)
method on any HierarchicalLogger
instance (e.g. DataAPIClient
, Db
, Collection
, etc.).
See the logging examples for more information.
Overhaul of the timeout system*
The timeout system has been overhauled to be more flexible and descriptive than the current singular maxTimeMS
.
Timeouts are now configured through the timeoutDefaults
parameter on class options interfaces, and the timeout
parameter on method calls.
They are represented by the TimeoutDescriptor
class, which contains the six following keys:
Timeout Option | Description | Default |
---|---|---|
requestTimeoutMs |
Maximum time the client waits for a response from the server | 15 seconds |
generalMethodTimeoutMs |
Timeout for general methods without a specific override (mostly doc/row-level ops) | 30 seconds |
collectionAdminTimeoutMs |
Timeout for collection admin operations (create, drop, list, etc.) | 1 minute |
tableAdminTimeoutMs |
Timeout for table admin operations (create, drop, list, alter, create/dropIndex, etc.) | 30 seconds |
databaseAdminTimeoutMs |
Timeout for database admin operations (create, drop, list, info, findEmbeddingProviders, etc.) | 10 minutes |
keyspaceAdminTimeoutMs |
Timeout for keyspace admin operations (create, drop, list) | 30 seconds |
In general, the requestTimeoutMs
always corresponds to a single request from the server, but the rest of the timeouts account for the entire duration of the method, which is relevant in the case of multi-call methods.
A few important notes:
requestTimeoutMs
applies per individual HTTP request.- The other timeouts account for the entire duration of the method, which is relevant in the case of multi-call methods.
- Passing a
timeout
value as a plain number will use the most appropriate category for the method being called. - Setting a
timeout
to 0 disables it completely. - The legacy maxTimeMS option has been removed—simply replace it with
timeout
for a quick migration path.
Overhaul of cursors*
v2.0.0-rc.1
v2.0.0-preview.5
v2.0.0-preview.4
v2.0.0-preview.3
v2.0.0-preview.2
- fix for process.env in the browser 7517a12
v2.0.0-preview.1
- 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
NOTE
The release notes are still under construction
The current commit list is just temporary
- slgihtly updated readme e86b308
- TSDoc + typing improvements + tweaks (#89) 0faa849
- Switch to codec-based ser/des system (#88) cfcf437
- Added complex r/w-aware
Table
&Collection
types (#87) 95f8a41 - TSDoc progress + other minor fixes (#86) f31127b
- Various minor tweaks & cleanups for 2.0 (#84) 9a933f7
- Various 2.0 cleanups/tweaks (#83) 09d1d66
- Initial tables tests (#82) 9b26268
- Timeouts overhaul (#81) c8dc9fa
- Cursor split + tests (#80) 50361dd
- minor-ish tweaks/fixes 605d9ff
- Admin class overhauls (#79) 68873cb
- Rough, complete, roughly complete
Table
implementation (#78) d0c6e0b - Initial logging implementation (#77) bee45ab
- Cursor refactors & alignment (#76) 4cca38f
- Initial tables implementation (#75) 432c807
- Deprecated features removal (#74) fc26224
- Major folder restructuring (#73) 263e90d
- updated eslint config 5dbedcd