One script tag, one global

@inlaysql/simple is the jQuery-shaped face of the SDK: an InlaySQL global, shorthand models, and search that guesses its columns from the schema.

const db = await InlaySQL.open();

const pages = await db.model("pages", {
  id: "integer primary key",
  title: "text",
  body: "text bm25",
  embedding: "vector(64) hnsw from:body",
});
await pages.insert([{ title: "Renew a passport", body: "…" }]);

const hits = await db.search("pages", "renew a passport", { limit: 1 });

  

loading…