Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

fix(deps): update dependency surrealdb.js to ^0.11.0 #387

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Aug 23, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
surrealdb.js ^0.7.3 -> ^0.11.0 age adoption passing confidence

Release Notes

surrealdb/surrealdb.js (surrealdb.js)

v0.11.0

Compare Source

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 (and surql 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
New Contributors

Full Changelog: surrealdb/surrealdb.js@v0.10.1...v0.11.0

v0.10.1

Compare Source

What's Changed

Full Changelog: surrealdb/surrealdb.js@v0.10.0...v0.10.1

v0.10.0

Compare Source

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

Full Changelog: surrealdb/surrealdb.js@v0.9.1...v0.10.0

v0.9.1

Compare Source

What's Changed

New Contributors

Full Changelog: surrealdb/surrealdb.js@v0.9.0...v0.9.1

v0.9.0

Compare Source

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

Full Changelog: surrealdb/surrealdb.js@v0.8.4...v0.9.0

v0.8.4

Compare Source

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

Full Changelog: surrealdb/surrealdb.js@v0.8.3...v0.8.4

v0.8.3

Compare Source

Overview

The NS and DB properties are now optional in signin/signup functions for Scope authentication. They are still required for namespace and database user authentication!

What's Changed

New Contributors

Full Changelog: surrealdb/surrealdb.js@v0.8.2...v0.8.3

v0.8.2

Compare Source

What's Changed

Full Changelog: surrealdb/surrealdb.js@v0.8.1...v0.8.2

v0.8.1

Compare Source

Notes on this release
  • Implemented the .info() method for the websocket strategy
    • The info method will essentially run: SELECT * FROM $auth
    • You can pass a generic type which contains the fields that the above query will return, based on the authenticated scope user
  • Further implemented methods for the experimental HTTP strategy
  • Made this a patch as it only implements new methods :)
What's Changed

Full Changelog: surrealdb/surrealdb.js@v0.8.0...v0.8.1

v0.8.0

Compare Source

Notes on this release
  • Breaking: Fix typings for .select(), .create(), .update(), .merge(), .patch(), .delete()

    • After this PR, all of the above mentioned functions will always return an array, regardless of the method or if you are selecting a table or a specific record.
    • The .select() methods now returns an array instead of a single item.
    • The .change() method is renamed to .merge().
    • The .modify() method is renamed to .patch().
    • The above mentioned functions now always return an array, never a single item or undefined.
  • Breaking: The .use() function now accepts an object as an argument .use({ ns, db }).

  • You can now pass an auth property to the second argument of the constructor and connect functions. This can be a token string or an object you would pass to the .signin() function.

  • You can now pass a pair of { ns, db } to the second argument of the constructor and connect functions.

  • The auth state and ns/db combo will now be remembered after a possible WebSocket disconnect and will automatically be restored.

  • Added back the Live Queries implementation (read down below)

Live Queries implementation

Start a live query

const uuid = await surreal.live<{
    id: string;
    prop: number;
}>("query...", (data) => {
    if (data.action === 'CLOSE") return;
    console.log(data.result);
});

Register another listener for an LQ

await surreal.listenLive<{
    id: string;
    prop: number;
}>("uuid...", (data) => {
    if (data.action === 'CLOSE") return;
    console.log("Second listener! ", data.result);
});

Kill a LQ

await surreal.kill("uuid...");
Data in callback
type close = {
    action: "CLOSE",
    detail: "SOCKET_CLOSED" | "QUERY_KILLED"
};

type create = {
    action: "CREATE";
    result: Record<string, unknown>;  // Generic type that was passed, always extends default type
};

type update = {
    action: "UPDATE";
    result: Record<string, unknown>;  // Generic type that was passed, always extends default type
};

type delete = {
    action: "DELETE";
    result: Record<string, unknown>;  // Generic type that was passed, always extends default type
};
What's Changed

Full Changelog: surrealdb/surrealdb.js@v0.7.3...v0.8.0 (might not completely align with above notes, v0.7.3 was a little bit quirky)


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 23, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: c8d096c
Status: ✅  Deploy successful!
Preview URL: https://2625e947.sonicj.pages.dev
Branch Preview URL: https://renovate-surrealdb-js-0-x.sonicj.pages.dev

View logs

@renovate renovate bot force-pushed the renovate/surrealdb.js-0.x branch 2 times, most recently from 3159a51 to 215e2fa Compare August 23, 2023 11:38
@renovate renovate bot changed the title fix(deps): update dependency surrealdb.js to ^0.8.0 fix(deps): update dependency surrealdb.js to ^0.9.0 Sep 12, 2023
@renovate renovate bot force-pushed the renovate/surrealdb.js-0.x branch from 215e2fa to 579cf48 Compare September 12, 2023 22:55
@renovate renovate bot changed the title fix(deps): update dependency surrealdb.js to ^0.9.0 fix(deps): update dependency surrealdb.js to ^0.10.0 Oct 30, 2023
@renovate renovate bot force-pushed the renovate/surrealdb.js-0.x branch from 579cf48 to 4297ff6 Compare October 30, 2023 11:40
@renovate renovate bot changed the title fix(deps): update dependency surrealdb.js to ^0.10.0 fix(deps): update dependency surrealdb.js to ^0.11.0 Nov 1, 2023
@renovate renovate bot force-pushed the renovate/surrealdb.js-0.x branch from 4297ff6 to c8d096c Compare November 1, 2023 13:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants