[RELEASE] v2.0.0-beta8 #4459
jarohen
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Here's beta8 🚀
We've got some XTQL changes to tell you about, some improvements to the type-handling in the XT JDBC driver, and some breaking changes.
Let's get started!
XTQL-in-SQL
Previously, SQL and XTQL have lived in two separate worlds in XTDB. With this release, XTQL is brought back onto the main stage: XTQL queries are now a first-class part of our SQL syntax, and can be sent through the JDBC driver!
Here we're taking advantage of SQL's relational algebra roots - the ability to compose larger queries out of smaller sub-queries. Each relational algebra operator (e.g. select, project, join, aggregate) has a common structure - relation(s) in, relation out - and it's this homogeneity (or, to give it the algebraic term, 'closure' under its operations) that means we can simply add XTQL as another source operator.
It's included as a string within SQL - most commonly, using dollar-delimited strings:
This means that you can use XTQL in your favourite SQL BI tooling - like Metabase:
We'd love to hear how you make use of this new XTQL reach!
To integrate XTQL into SQL queries, we've had to make one non-trivial breaking change to XTQL syntax: given SQL's parameters are positional rather than named, we've brought XTQL in line too. In your query, you now use
fnto name the parameters, as follows:XTDB JDBC driver
Previously, the XTDB JDBC driver was simply a very thin wrapper around the Postgres JDBC driver - an indulgence so that you could specify
jdbc:xtdb://...as your connection string rather thanjdbc:postgresql://....Now, it actually earns its keep!
Through the changes in beta8, our JDBC driver now understands the wide range of types available in XTDB:
java.timetypes, bringing JDBC into the 21st century - including timestamps that preserve timezone information.If you're using our JDBC driver - either directly or through libraries like Clojure's
next.jdbc, you can now submit these directly as query arguments, and you should also transparently see these types in your result set.Finally, if you're using an in-memory node, this now implements
javax.sql.DataSource, so you can pass this directly to libraries likenext.jdbcor HikariCP.This also involved a couple of breaking changes:
.getObjecton the returned result-set, you'll get a richer type thanPgObjectorjava.sql.Timestamp.next.jdbchelper functions, you'll likely no longer need to - and indeed, most of them have been removed (particularly->pg-obj).xtdb-apiartifact - you'll need to removextdb-jdbcfrom your dependency manager.Operational improvements
In beta8, we've also been working on operational improvements, largely around backup/restore and disaster recovery - these are now documented in the operations manual.
One to draw to your attention, though, is the new 'log epoch' safety net: if your transaction log is corrupted/lost/misplaced, XTDB will now smoke-test the log topic on startup, and refuse to start if there are messages missing.
To resolve this, you now have the option to keep whatever data has been persisted in XTDB's object store, but start with a new, empty topic. Let the XTDB cluster know what's happened by incrementing the log epoch, and XTDB will continue from the most recently persisted block.
SQL changes
There are a few quality-of-life SQL changes to tell you about:
(breaking)
FROM my_table FOR VALID_TIME FROM NULL TO <to>,FROM my_table FOR VALID_TIME TO <to>(i.e.FROM <from>elided), and similarly forUPDATE|DELETE <table> FOR PORTION OF VALID_TIME FROM ... TO ...will now return/update data from the start of time, rather than from now.If the whole clause is elided (e.g.
FROM my_table,UPDATE|DELETE <table> SET ...), the default remains for VT 'now -> ∞', as before.FOR VALID_TIME AS OF|FROMnow support parameters and/or full expressions - e.g.:FROM my_table FOR VALID_TIME AS OF ?FROM my_table FOR VALID_TIME FROM (NOW - INTERVAL 'P30D') TO NOWIn
BEGIN, you can set various options within the scope of the transaction:These, too, support parameters and/or full expressions.
We've added URI functions in the standard library - no need to regex your way out of this one any more!
Elsewhere
So much for beta8 being a small release!
As always, for a full list of closed cards, see the milestone.
Cheers!
James & the XT team
This discussion was created from the release v2.0.0-beta8: Here's beta8 🚀.
Beta Was this translation helpful? Give feedback.
All reactions