0.0.21 • Published 5 years ago

sqlite-repository v0.0.21

Weekly downloads
84
License
-
Repository
-
Last release
5 years ago

Introduction

Here are the features for this node module.

  • Create
  • Read
  • Update
  • Delete
  • Create Tables
  • Drop Tables

Schema

Everything with sqlite repository relies on a schema declaration. Here is the specification.

Simple Schema

const personTable = {
    name: "person",
    version: "1.0.0",
    label: "People",
    description: "A place to store people.",
    columns: [
        {
            type: "INTEGER",
            name: "id",
            label: "Identity"
        },
        {
            type: "TEXT",
            name: "firstName",
            label: "First Name"
        },
        {
            type: "TEXT",
            name: "lastName",
            label: "Last Name"
        }
    ],
    primaryKeys: ["id"]
};

Foreign Keys

const = {
    name: "address",
    label: "Address",
    description: "Address Table",
    version: "1.0.0",
    columns: [
        {
            type: "INTEGER",
            name: "id",
            label:"Identifier"
        },
        {
            type: "TEXT",
            name: "address",
            label: "Address"
        },
        {
            type: "TEXT",
            name: "city",
            label: "City"
        },
        {
            type: "INTEGER",
            name: "state",
            label: "State"
        },
        {
            type: "INTEGER",
            name: "zipCode",
            label: "Zip Code"
        },
        {
            type: "INTEGER",
            name: "personId",
            label: "Person Id",
            isRequired: true
        }
    ],
    primaryKeys:["id"],
    foreignKeys: {
            personId: {
                label: "Person",
                source: {
                    name: "person",
                    version: "1.0.0",
                    label: "Addresses",
                    column: "id"
                }
            }
    }
};

Create

    import { Database } from "sqlite-repository";
    
    
0.0.21

5 years ago

0.0.20

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago