Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
function createItem
import { createItem } from "https://deno.land/x/netzo@0.2.94/plugins/portals/utils/db.ts";

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

Examples

Example 1

import { createItem } from "netzo/plugins/portals/utils/db.ts";
import { ulid } from "std/ulid/mod.ts";

await createItem({
  id: ulid(),
  userLogin: "john_doe",
  title: "example-title",
  url: "https://example.com",
  score: 0,
});