0.4.10 • Published 7 years ago

typedsequelize v0.4.10

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

TypedSequelize

typescript source generator for sequelize & rpc
Code First model

How to use

Model Definition

Just declare & implement class.
Not support inherit now
Not support n:m relation now

@model
export class Person {
    first_name: string;
    last_name: string;
    age: number;
}

Source generation

run bin/cli.js
node bin/cli.js --outdir src/gen --inputs src/def/person.ts

src/gen/person_models.ts will be generated.

Now you can use Person in src/gen/person_models.

or you can use typedseq.json as config file.
below is an example that works same with above command.

{
  "outdir": "src/gen",
  "inputs": [
    "src/def/person.ts"
  ]
}

jsut run node bin/cli.js

Decorators

  • concreteType()
    • Specify Sequelize Type
  • embededField()
    • Each fields are saved into seperated fields.
  • primaryKey()
    • Set decorated property as primary key
  • arrayJoinedWith(seperator: string)
    • Array is saved with specified seperator

TODO

See Issues page

0.4.10

7 years ago

0.4.9

7 years ago

0.4.8

7 years ago

0.4.7

7 years ago

0.4.6

7 years ago

0.4.5

8 years ago

0.4.4

8 years ago

0.4.3

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.4

8 years ago

0.3.3

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

1.0.0

8 years ago