Skip to main content
The Deno 2 Release Candidate is here
Learn more
Go to Latest
import * as netzo from "https://deno.land/x/netzo@0.2.84/plugins/portals/utils/db.ts";

Functions

Returns an array of values of a given Deno.KvListIterator that's been iterated over.

Creates a new item in the database. Throws if the item already exists in one of the indexes.

Creates a new user in the database. Throws if the user or user session already exists.

Gets the item with the given ID from the database.

Gets the user with the given login from the database.

Gets the user with the given session ID from the database. The first attempt is done with eventual consistency. If that returns null, the second attempt is done with strong consistency. This is done for performance reasons, as this function is called in every route request for checking whether the session user is signed in.

Returns a Deno.KvListIterator which can be used to iterate over the items in the database, in chronological order.

Returns a Deno.KvListIterator which can be used to iterate over the items by a given user in the database, in chronological order.

Returns a Deno.KvListIterator which can be used to iterate over the users in the database.

For testing

For testing

Creates a user in the database, overwriting any previous data.

Updates the session ID of a given user in the database.