Releases: surrealdb/surrealdb.js
v1.0.0-beta.3
v1.0.0-beta.2
What's Changed
Full Changelog: v1.0.0-beta.1...v1.0.0-beta.2
v1.0.0-beta.1
What's Changed
Full Changelog: v0.11.1...v1.0.0-beta.1
Release v0.11.1
What's Changed
- Update README.md by @kearfy in #200
- Add CONTRIBUTING.md by @naisofly in #201
- Fix live test by @kearfy in #225
- fix: reject send promise upon catching inner error by @oliver-oloughlin in #220
- fix: allow TemplateStringsArray as argument to
surrealql()
by @oliver-oloughlin in #222 - Bump v0.11.1 by @kearfy in #226
New Contributors
- @naisofly made their first contribution in #201
- @oliver-oloughlin made their first contribution in #220
Full Changelog: v0.11.0...v0.11.1
Release v0.11.0
Overview
Simplified .query()
method
To further align our JS landscape, the current .query()
method is renamed to .query_raw()
, and a new and simplified .query()
method is introduced. This new method either throws an error or gives back an array of response values.
await db.query<boolean, number>(`true; 123`);
// [true, 123]
// This would previously be an array with query response objects, containing the result.
await db.query(`THROW "some error"`);
// Throws: "An error occurred: some error"
Tagged template literals
- We now expose a
PreparedQuery
class which can be passed to the.query()
and.query_raw()
methods. - We now expose a
surrealql
(andsurql
as a shortcut) function which can be used as a tagged template literal.
const name = "John Doe";
const age = 44;
// With PreparedQuery
const query = new PreparedQuery(
/* surql */`RETURN $name; RETURN $age`,
{ name, age }
);
const prepared = await db.query(query);
// With a tagged template literal
const templated = await db.query(
surrealql`RETURN ${name}; RETURN ${age}`
);
What's Changed
- Update README.md to address namespace and database naming changes by @Nipodemos in #188
- Simplified query method by @kearfy in #189
- Tagged template literals by @kearfy in #190
- Improved auth tests by @kearfy in #191
- Bump v0.11.0 by @kearfy in #192
New Contributors
- @Nipodemos made their first contribution in #188
Full Changelog: v0.10.1...v0.11.0
Release v0.10.1
What's Changed
Full Changelog: v0.10.0...v0.10.1
Release v0.10.0
Overview
ns
/db
/sc
/user
/pass
renamed to namespace
/database
/scope
/username
/password
This change was introduced to better align the JS SDK with the Rust SDK and the rest of our JavaScript landscape
Old behaviour
await db.use({
ns: 'test',
db: 'test'
});
await db.signin({
ns: 'test',
db: 'test',
user: 'root',
pass: 'root'
});
await db.signin({
ns: 'test',
db: 'test',
sc: 'user',
...
});
New behaviour
await db.use({
namespace: 'test',
database: 'test'
});
await db.signin({
namespace: 'test',
database: 'test',
username: 'root',
password: 'root'
});
await db.signin({
namespace: 'test',
database: 'test',
scope: 'user',
...
});
What's Changed
- Micha/naming typing improvements by @kearfy in #181
- Change tests so that
.authenticate()
is tested for both scope and root users by @kearfy in #182 - Add
boolean
toRawQueryResult
by @kearfy in #183 - Bump v0.10.0 by @kearfy in #184
Full Changelog: v0.9.1...v0.10.0
Release v0.9.1
What's Changed
- Add missing JSON patch operations by @meppu in #168
- Update README.md by @koba-ninkigumi in #169
- fix: stringify all variables by @martinschaer in #171
- Test that query variables are properly encoded by @kearfy in #174
- Always forward rejection, no matter the error type by @kearfy in #175
- Bump v0.9.1 by @kearfy in #176
New Contributors
- @meppu made their first contribution in #168
- @koba-ninkigumi made their first contribution in #169
- @martinschaer made their first contribution in #171
Full Changelog: v0.9.0...v0.9.1
Release v0.9.0
Overview
- The constructor method of the Surreal class does not accept a URL and configuration options anymore. This, because if an error would be thrown from the promise based function it invoked (like an unreachable address), it would be impossible to catch it. Aside from that, this streamlines the JS and WASM libraries towards eachother. Any arguments previously passed to the contructor method will now need to be separately passed to the
.connect()
function (which can be awaited by the way!) .authenticate()
now returns a boolean indicating success or not success. Be aware that authentication errors will still result in an error being thrown!- Improved promise and error handling in general
- Removed Bun tests as their websocket implementation is currently experimental and not working properly.
What's Changed
- Improvements to promises + error handling. Drop support for URL on constructor method by @kearfy in #165
- Bump v0.9.0 by @kearfy in #166
Full Changelog: v0.8.4...v0.9.0
Release v0.8.4
Overview
- You can now pass variables to the
.query()
method for the experimental HTTP strategy - Implemented a
.insert()
method to allow for bulk record insertion - Added a third option
diff
to the.live()
method, which allows you to receive back notifications in the form of JSON Patches. - Finished off the internals for the live queries implementation and added tests for them (they are now actually functional!!)
As most of this is only available with the nightly version of SurrealDB, I would like to link the nightly docs (all though a bit buggy here and there) aswell: https://deploy-preview-197--coruscating-puppy-14fc4b.netlify.app/
What's Changed
- Allow vars in HTTP query method by @kearfy in #148
- Implement
.insert()
method by @kearfy in #150 - Implement
.live()
diff option by @kearfy in #151 - Remove debugging leftovers by @kearfy in #152
- Rename
FEATURE_TEMPLATE
->ISSUE_TEMPLATE
by @kearfy in #154 - Fix discussions link by @kearfy in #155
- Fix the discussions link, again... by @kearfy in #157
- Finish up live queries implementation by @kearfy in #160
- Add test for
.insert()
by @kearfy in #161 - Bump v0.8.4 by @kearfy in #162
Full Changelog: v0.8.3...v0.8.4