0.2.6 • Published 6 years ago

cws-ts-generator v0.2.6

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago
`npm install -g cws-ts-generator`
  • This script will create a dir named output in your root directory

  • Inside output will be a dir: persistent-classes, a file: [app-name].generated.d.ts, and a file: Orm.ts

###CLI:
cws-ts-generator -d <database> -u <user> -x <pass> -h <host> -d <dialect> -p <port> -s <skipTables> -t <throughTableIdentifiers> -r <shouldWriteRelations> -l <lookup tableName>,<lookup.start | null>,<lookup.end | null>

###Programmatically:

    let cwsGenerate = require("cws-ts-generator");

    const configOptions = {
        config: {
            db: "db name",
            user: "user name",
            pass: "password",
            host: 'host',
            dialect: "mssql | postgresql | mysql"
        },
        skipTables: ["tableToSkip", "otherTableToSkip", "etc"],   // examples to skip
        primaryKeyIdentifier: "yourPrimaryKeyForEveryTable",             // common name of primary key
        throughTableIdentifiers: ["2", "Map"],   // these substrings are in every map table, so generator can properly map `through` tables
        lookup: {                 
            tableName: "Lookup",  // for constant table that maps keys to value
            start: "lkp",        // start of created extra prop
            end: "OidObject"     // end of created extra prop
        },
        shouldWriteRelations: true   // write extra props defining one:many, many:many relationships
    };


    // execute generator
    cwsGenerate.exec(configOptions).then((res) => {
        console.log(res);
    })
0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.99

6 years ago

0.1.98

6 years ago

0.1.97

6 years ago

0.1.96

6 years ago

0.1.95

6 years ago

0.1.94

6 years ago

0.1.93

6 years ago

0.0.93

6 years ago

0.0.92

6 years ago

0.0.91

6 years ago

0.0.9

6 years ago

0.0.85

6 years ago

0.0.84

6 years ago

0.0.83

6 years ago

0.0.82

6 years ago

0.0.81

6 years ago

0.0.8

6 years ago

0.0.78

6 years ago

0.0.77

6 years ago

0.0.76

6 years ago

0.0.75

6 years ago

0.0.74

6 years ago

0.0.73

6 years ago

0.0.72

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