Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.
zenlorPublic archive

About

Type definition for node-sql table definition

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQLTypes

Simple SQL column type definition for node-sql

Examples

Define a table:

import * as Sql from "sql";
import { SQLSerial, SQLInt, SQLString, SQLText, SQLRef } from "./sql_types";

export const Todo = Sql.define({
    schema: "public",
    name: "todo",
    columns: {
        id: SQLSerial,
        user_id: SQLString,
        client_id: SQLString,
        job_id: SQLRef(SQLInt, "jobs", "id"),
        title: SQLString,
        description: SQLText,
    },
});

Extend a type:

import { SQLSerial, SQLInt, SQLString, SQLText, SQLRef } from "./sql_types";

const SQLBigInt = Object
    .assign({}, SQLInt, { dataType: "bigint" });

License

ISC

About

Type definition for node-sql table definition

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages