Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/justaos_orm/src/table/Table.ts>default#getRecord

JUSTAOS's ORM (Object–relational mapping) tool is built for Deno and provides transparent persistence for JavaScript objects to Postgres database.
Latest
method default.prototype.getRecord
import { default } from "https://deno.land/x/justaos_orm@v10.0.0/src/table/Table.ts";

Get a record by its ID or a column name and value

Examples

Example 1

const record = await table.getRecord('id', '123');
const record = await table.getRecord('123');
const record = await table.getRecord({id: '123'});
const record = await table.getRecord({id: '123', name: 'test'});

Parameters

idOrColumnNameOrFilter: UUID4 | string | { [key: string]: any; }
  • The ID of the record or a column name and value
optional
value: any
  • The value of the column

Returns

Promise<Record | undefined>

The record or undefined if not found