profile
viewpoint

Kononnable/typeorm-model-generator 960

Generates models for TypeORM from existing database.

Kononnable/typeorm 1

Amazing ORM for TypeScript and JavaScript (ES7, ES6, ES5). Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.

Kononnable/cordova-example 0

Example project to demonstrate TypeORM in a Cordova app

Kononnable/diesel 0

A safe, extensible ORM and Query Builder for Rust

Kononnable/moby 0

Moby Project - a collaborative project for the container ecosystem to assemble container-based systems

fork Kononnable/moby

Moby Project - a collaborative project for the container ecosystem to assemble container-based systems

https://mobyproject.org/

fork in 20 days

issue closedKononnable/typeorm-model-generator

snake_case for properites

Unable to use the naming strategy for creating snake case of column names, it converts back to camelcase post naming strategy call

closed time in 24 days

sursma

issue commentKononnable/typeorm-model-generator

snake_case for properites

Implemented in typeorm-model-generator@0.4.3

sursma

comment created time in 24 days

issue closedKononnable/typeorm-model-generator

RelationIds set to true generates incorrect types

I have two tables: user and role. The user table has a column called role_id of type INT. It also has a foreign key referencing the id column in the role table.

Using model generator with the following options:

typeorm-model-generator -d db_name -h $dbhost -u $user -x $password -p 3306 -e mysql -o "$output" --cf "camel" --ce "pascal" --cp "camel" --noConfig --relationIds true

yields the following in the user model file:

    @ManyToOne(()=>Role, (role: Role)=>role.users,{  nullable:false,onDelete: 'NO ACTION',onUpdate: 'NO ACTION' })
    @JoinColumn({ name:'role_id'})
    role:Role | null;

    @RelationId((user: User) => user.role)
    roleId: number[];

The issue is that the generated roleId property should be of type number and not number[].

closed time in 24 days

ebrahimB

issue commentKononnable/typeorm-model-generator

RelationIds set to true generates incorrect types

Implemented in typeorm-model-generator@0.4.3

ebrahimB

comment created time in 24 days

issue closedKononnable/typeorm-model-generator

[POSTGRES] GENERATED ALWAYS AS IDENTITY doesn't get @PrimaryGeneratedColumn decorator

Hiya - fantastic tool! Amazed at how much it seems to have extracted from my database... but...

I might be confused, but I generated this table in postgres:

CREATE TABLE "address" ( "addressId" INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY);

When running typeorm-model-generator with defaults, the resultant model had addressId like so:

@Column("integer", { primary: true, name: "addressId" }) addressId: number;

As a beginner with type-orm, I was expecting

@PrimaryGeneratedColumn({ name: "addressId" }) addressId: number;

I hope I've given enough detail to be clear / allow for reproduction but apologies if not, I can supply them naturally. Thanks in advance!

closed time in 24 days

garethhcoleman

issue commentKononnable/typeorm-model-generator

[POSTGRES] GENERATED ALWAYS AS IDENTITY doesn't get @PrimaryGeneratedColumn decorator

Implemented in typeorm-model-generator@0.4.3

garethhcoleman

comment created time in 24 days

issue closedKononnable/typeorm-model-generator

How to create a specific entity by given a table name?

I'm a new for using typeorm-model-generator, and I want to find a way to generate a specific entity by using a given table name.

Is there a way we can do it now, or can you support this functionality in future?

Like, we have a table name job, and we want to generate Job entity by given a flag -t job and only generate this entity when give this flag.

closed time in 24 days

jasonyoung92

issue commentKononnable/typeorm-model-generator

How to create a specific entity by given a table name?

Implemented in typeorm-model-generator@0.4.3

jasonyoung92

comment created time in 24 days

CommitCommentEvent

created tagKononnable/typeorm-model-generator

tagv0.4.3

Generates models for TypeORM from existing database.

created time in 24 days

push eventKononnable/typeorm-model-generator

kononnable

commit sha 63e4ccfcc6c04eb6646d2f82439541f3b5e8b1ba

changelog

view details

kononnable

commit sha 96a52f048fe89675f4bf0415ce90e6501d0f8134

remove unnecessary files from npm package

view details

kononnable

commit sha 4f3a03482e34c6ee27eb14b7cafc4173ba898077

0.4.3

view details

push time in 24 days

push eventKononnable/typeorm-model-generator

kononnable

commit sha 3ce67d38e1e776728c0816c0420fdfc36f5d3c23

update dependencies

view details

kononnable

commit sha 414a17dfa5c06afa6cbce6082f147de2db1b8220

update node versions tested on travis

view details

Allan Amstadt

commit sha afe212e49bbbef3f1061009433e671e39a97caba

fix(package): Fixed Bug where mssql Driver IsIdentity is not working with non dbo schemas

view details

Kononnable

commit sha 86c2dd4bc54159fbfa3bdb4616a2426083f29ff0

upgrade dependencies

view details

Paweł Kotarski

commit sha 194c5e502b6fec60c52fa0a3b6244aea69de3f10

Merge pull request #275 from iteufel/master Fixed Bug where mssql Driver IsIdentity is not working with none dbo schemas

view details

Paweł Kotarski

commit sha a77cc79a2720b8035311047a69c0f44e85d67301

Create stale.yml Stale issue action test

view details

Paweł Kotarski

commit sha cfc04c5dd63e9d700a8f304467a2ce1f3e692cc2

Update stale.yml

view details

Paweł Kotarski

commit sha 6b16608c1eaa36c401919589a99ca632a99c20f9

Delete stale.yml

view details

Paweł Kotarski

commit sha 82c2122bcf4ddf7d54d6bac3b1b8475eb651430c

Create stale.yml

view details

Matt Hilliard

commit sha ce78c378742a561c128b075da87e969f998dd388

Makes Postgres driver aware of new identity columns

view details

Matt Hilliard

commit sha 834d1f1d6123941aef45d583d0299ef89bdb79e2

Fix for #1795. @ManyToOne relations should not have an array type.

view details

zhangrubing

commit sha e4761d8f5023e5f7e07d61c0061cac3b9e345b38

Add snake case properties

view details

zhangrubing

commit sha 8bbe1a617d9c5806cb97ca44df1c0b32bc378638

Remove no use import

view details

pc3b3r

commit sha 15638307715cc332e2c86dcc2d7c2afe9c452c1f

add connectionOptions for tables selection

view details

pc3b3r

commit sha ef5371c19664336a6b94ab424840615fd7e13fda

inquirer options for selecting specific tables

view details

pc3b3r

commit sha defe6fd63ffab3d6165c22c27f4f719428fd45cd

driver params for IN tables

view details

pc3b3r

commit sha b1335eed7f1166f913d6cb12f718bbab7a420ef8

drivers query IN

view details

pc3b3r

commit sha 06653f96edda6bcda658c26e4fe4da0937aa8588

IConnectionOptions fix for tests

view details

kononnable

commit sha 0fad9be4420209a2560ea44af71a773438a151a5

add test

view details

Paweł Kotarski

commit sha 2717bf0295cbefc988d547a6061f08ea48235976

Merge pull request #295 from zrubing/Add-snake-case-property Add snake case property

view details

push time in 24 days

issue commentKononnable/typeorm-model-generator

[MSSQL] UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'startsWith' of null

Looks like there is an index with null name. Weird. Which db engine(and version) are you using?

hunglee

comment created time in a month

push eventKononnable/typeorm-model-generator

kononnable

commit sha 5d66340ce31f2667673bba6aaa9054efe1f16172

update dependencies

view details

push time in a month

issue commentKononnable/typeorm-model-generator

[oracle] Tables not found in selected database. Skipping creation of typeorm model.

Could you check the workaround from #112 ? It looks like the same issue.

liudonghua123

comment created time in a month

push eventKononnable/typeorm-model-generator

dependabot[bot]

commit sha 8b50f21a4884c0e585a458715baff65bcde5f6c9

Bump bl from 3.0.0 to 3.0.1 Bumps [bl](https://github.com/rvagg/bl) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](https://github.com/rvagg/bl/compare/v3.0.0...v3.0.1) Signed-off-by: dependabot[bot] <support@github.com>

view details

Paweł Kotarski

commit sha c106bf8cab7aec3aad243f1a0367147d185eef3a

Merge pull request #298 from Kononnable/dependabot/npm_and_yarn/bl-3.0.1 Bump bl from 3.0.0 to 3.0.1

view details

push time in a month

PR merged Kononnable/typeorm-model-generator

Bump bl from 3.0.0 to 3.0.1 dependencies

Bumps bl from 3.0.0 to 3.0.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/rvagg/bl/releases">bl's releases</a>.</em></p> <blockquote> <h2>v3.0.1</h2> <p>Fix unintialized memory access</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/rvagg/bl/commit/84e1852465572927d9151e6484f351d712b94dea"><code>84e1852</code></a> Bumped v3.0.1</li> <li><a href="https://github.com/rvagg/bl/commit/8a8c13c880e2bef519133ea43e0e9b78b5d0c91e"><code>8a8c13c</code></a> Fix unintialized memory access</li> <li>See full diff in <a href="https://github.com/rvagg/bl/compare/v3.0.0...v3.0.1">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+3 -3

0 comment

1 changed file

dependabot[bot]

pr closed time in a month

push eventKononnable/typeorm-model-generator

pc3b3r

commit sha 15638307715cc332e2c86dcc2d7c2afe9c452c1f

add connectionOptions for tables selection

view details

pc3b3r

commit sha ef5371c19664336a6b94ab424840615fd7e13fda

inquirer options for selecting specific tables

view details

pc3b3r

commit sha defe6fd63ffab3d6165c22c27f4f719428fd45cd

driver params for IN tables

view details

pc3b3r

commit sha b1335eed7f1166f913d6cb12f718bbab7a420ef8

drivers query IN

view details

pc3b3r

commit sha 06653f96edda6bcda658c26e4fe4da0937aa8588

IConnectionOptions fix for tests

view details

kononnable

commit sha a3edec7119fb9584e7ee1b98d0b22beba023d8ee

move table filtering logic

view details

kononnable

commit sha 79e9ae0fab1622f51a2cfa81036f85abde5c9a58

add tests

view details

kononnable

commit sha 5b290a5632dbb5b2b83e14de8df05c6b51f431df

fix lint issues

view details

Paweł Kotarski

commit sha b31081deedc229b6ff3083a88fd9539c58a40aaa

Merge pull request #296 from pc3b3r/relevantTables Relevant tables

view details

push time in a month

PR merged Kononnable/typeorm-model-generator

Relevant tables

Related to https://github.com/Kononnable/typeorm-model-generator/issues/263 added inquirer option and CLI as -tables param

+152 -88

1 comment

10 changed files

pc3b3r

pr closed time in a month

pull request commentKononnable/typeorm-model-generator

Relevant tables

Thanks for the contribution. I've changed when filtering takes place. It will allow to skip generation of entities even if they're related to other(generated) tables.

pc3b3r

comment created time in a month

push eventpc3b3r/typeorm-model-generator

kononnable

commit sha 5b290a5632dbb5b2b83e14de8df05c6b51f431df

fix lint issues

view details

push time in a month

push eventpc3b3r/typeorm-model-generator

kononnable

commit sha a3edec7119fb9584e7ee1b98d0b22beba023d8ee

move table filtering logic

view details

kononnable

commit sha 79e9ae0fab1622f51a2cfa81036f85abde5c9a58

add tests

view details

push time in a month

issue commenttypeorm/typeorm

Allow column name for lazy loaded relation

The only thing which comes to my mind is use simple mapping function - before the need to print the object/pass somewhere where you need property without __. It isn't convenient but either this or not using promise-based lazy relations.

IntellectProductions

comment created time in a month

PR closed Kononnable/typeorm-model-generator

Extended decorators

Request #159 touched on this. Its a feature I needed and generators aren't much use if there's things that can't be automated; so added it--its forked with my earlier bugfixes, so assuming those make it upstream, this should all be the last commit. As most sane schemas follow rules like "your tombstone column in every table is called X" the idea is you apply the cli flag --deleteDateColumn X and the decorators get generated. Likewise for creation, and update and versioning columns. Its extended to match on multiple names because, databases...

As per commit the changes are this:

Adds CLI-configurable column name decorators for TypeOrm decorators: @DeleteDateColumn, @CreateDateColumn, @VersionColumn, @UpdateDateColumn

Updates Column to know which (if any) decoratorPrefix is going to apply to a column. Updates entity template to render all prefixed decorators (replacing PrimaryGeneratedColumn logic) Updates IGenerationOptions to capture column names flagged for specific decorators. Updates index to capture generation options passed via cli. Adds setDecoratorPrefix method to model customizations to recognize when data matches the requested generation options.

CHEERS!

+113 -6

1 comment

7 changed files

seamuncle

pr closed time in 2 months

pull request commentKononnable/typeorm-model-generator

Extended decorators

I stand by the decision not to generate column decorators which can destroy existing data. Unless you're using other orm with exactly same logic as typeorm applying those decorators won't be enough. It can easily break data already stored in db.

As most sane schemas follow rules

Tables which don't follow convection(exceptions to the rules) are the problem here. I've worked on projects with many tables where almost all of them were done according to common rules, yet often there were a few which didn't follow those conventions completly. If we apply those decorators in such places we would literally destroy data saved there on our first write.

I think it's far safer to change that manually. Yeah, it will require some more work from developer, but no one wants to lose their data. If someone thinks he/she knows the database well enough and that there are no exceptions to the column naming convection they can still do simple find&replace. Writing a simple script which would get this process automated(if IDE replacement isn't enough) will take like 5 minutes. In addition replacement logic can be much more customized this way.

seamuncle

comment created time in 2 months

pull request commenttypeorm/typeorm

migration generation: update enumName for Postgres

I do not consider myself as part of typeorm team(or however we want to call it) for several months now, nor do I plan to come back to this role with the way things work here(not directly related to number of issues, prs). Because of that I won't be the one to merge this PR, so please don't ping me next time.

All I can say is that I'm sorry for the state of the typeorm, but I don't think I will be the one who change it. At least not with its current organization structure which I doubt will be ever changed.

osdiab

comment created time in 2 months

push eventKononnable/typeorm-model-generator

Matt Hilliard

commit sha ce78c378742a561c128b075da87e969f998dd388

Makes Postgres driver aware of new identity columns

view details

Matt Hilliard

commit sha 834d1f1d6123941aef45d583d0299ef89bdb79e2

Fix for #1795. @ManyToOne relations should not have an array type.

view details

kononnable

commit sha f46c0f8ca10b061f8b6edb25d4d1f8a2ad12bf71

fix test

view details

Paweł Kotarski

commit sha 71a64a74038158ac7a184382bcdd0c18a55d3712

Merge pull request #291 from seamuncle/master Makes Postgres driver aware of new identity columns

view details

push time in 2 months

PR merged Kononnable/typeorm-model-generator

Makes Postgres driver aware of new identity columns

Here's a barebones fix for the issues #2215, #274 and a handful of other duplicates I'm not too keen to curate.

You'll see more and more of this issue as the new "SQL standard" approach is getting a gentle push from the postgres peeps.

Because the issue originates in updates to Postgres 10 and on, it likely breaks 9.5 and 9.6, and all the unsupported versions. I'll leave what you want to support and how to do it up to you.

'll also let you address anything beyond this small fix that I made for my own db, while the change is trivial, I found looking for what changes to make time-consuming and i hope this helps you with that.

+8 -4

2 comments

3 changed files

seamuncle

pr closed time in 2 months

pull request commentKononnable/typeorm-model-generator

Makes Postgres driver aware of new identity columns

Ran test on pg 9.5, CI runs on pg 9.6, looks like is_identity columns already exists on those versions.

seamuncle

comment created time in 2 months

push eventseamuncle/typeorm-model-generator

kononnable

commit sha f46c0f8ca10b061f8b6edb25d4d1f8a2ad12bf71

fix test

view details

push time in 2 months

push eventKononnable/typeorm-model-generator

zhangrubing

commit sha e4761d8f5023e5f7e07d61c0061cac3b9e345b38

Add snake case properties

view details

zhangrubing

commit sha 8bbe1a617d9c5806cb97ca44df1c0b32bc378638

Remove no use import

view details

kononnable

commit sha 0fad9be4420209a2560ea44af71a773438a151a5

add test

view details

Paweł Kotarski

commit sha 2717bf0295cbefc988d547a6061f08ea48235976

Merge pull request #295 from zrubing/Add-snake-case-property Add snake case property

view details

push time in 2 months

push eventzrubing/typeorm-model-generator

kononnable

commit sha 0fad9be4420209a2560ea44af71a773438a151a5

add test

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha 352bf59e891ad754e0cb4870b5cb183d0ebf254a

fix CI build

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha 5c6c93320ceb5167a0f04d7d3d803934d600bfe4

fix CI build

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha 39a1e2782aa80d8ab05e3869fcdec7c642043508

use typescript composite build

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha 623e85083ebd4a085d5a0b9f2271bc578d5f64f6

extract mssql driver to separate package

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha b5117ae9e293d9afe7790305025578c7072ca510

extract mssql driver to separate package

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha d8fbeef156ef7510ff94f7fe8852440c41ec1784

extract oracledb driver to separate package

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha 67c9cc727d50d2fce759a1051e8512c90f103e36

extract mysql, aurora drivers to separate packages

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha c3d9694f4fa8be7ce3e5496414cfcb06c2ed4152

extract more drivers to separate packages: - cordova - nativescript - expo - react-native

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha e94bd25bcf1a7264777e54c0380b6eecb4c4a6e0

extract sap driver to separate package

view details

kononnable

commit sha 2ed9a49b6a2bda2d6a445f334148748cbb9983c3

extract sqlite driver to separate package

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha ef397b0bd3465f1d66ce3538af64bb4b50717887

extrack cockroachdb driver to separate package

view details

push time in 2 months

push eventKononnable/typeorm

Kononnable

commit sha 0620760ba6c059b2d36f591361e3e2d40ee57f69

extract sqljs driver to separate package

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha 3aeeae3cb2c11319f89c4cf5ef669e15e568dc2d

move sqljs autosave to sqljs driver

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha 33146607a884cb84abfc95ef1fa17e9d3bac43a0

remove comments which creates code sections

view details

push time in 2 months

startedlaunchbadge/sqlx

started time in 2 months

push eventKononnable/typeorm

kononnable

commit sha e9962127a97b10108d57a6fce627bfd9ddd49198

1

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha 4a61bccf572b1504d4a57ea71bbeb3e857256cb5

move postgres, aurora poistgres drivers to separate package

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha d6e106a21a1c42b9dc0218e37998c4608b75a44e

move mongodb driver to separate package

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha f53093e4ba03a74c6ab27b903f29a1efdf86b9e6

mongodb cleanup part2

view details

kononnable

commit sha 4a6ceb19bb78295aeb99af7dacd256a2749e2345

move connection options to typeorm-base

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha 4b7ac901fe01ac3ed0c3cf54e171977e973ab6b9

move mongodb specyfic code to single directory

view details

kononnable

commit sha e384f15d7baab4e7d332a515adceeb36759e5db1

mongodb cleanup part1

view details

kononnable

commit sha fc9dfb0e841db5d5c46b17a10258d1e2c6dffe4d

code prettifying

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha d74639a8e83e23c96744edb3ee701294a73f8161

remove entity manager factory

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha 1e5c8f6b7df20c091df217106249ba4608d70631

move reexported mongodb objectId

view details

kononnable

commit sha 255349d7cfe8aa71d3bb2c32c0ba9682819e8cdd

code prettifying

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha 500eb54cf7f8ab7756e65919abce406a3af61141

move db drivers to separate packages - part 1

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha 52bd04a842f06fcde7ad082ec8a7fc8669acf66a

small test related changes

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha 8f70b0857e455741ed9cbaf8c3ab42f0253cc4ab

small test related changes

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha bb2dfd0a777d0e7e1d871ba70dbdeb2efc6161da

separate orm settings from connection settings

view details

push time in 2 months

push eventKononnable/typeorm

kononnable

commit sha 96c73eed51324e2e5353cc71f2abefe149387fe2

separate orm settings from connection settings

view details

push time in 2 months

push eventKononnable/typeorm

Kononnable

commit sha 028604ce05b339336aa41c2cfe16619550274ae0

partial separate orm settings from connection settings

view details

push time in 2 months

push eventKononnable/typeorm

Kononnable

commit sha c3d857a9a0258260586feab24f7c666c025a601b

cleanup basic connection options -> typeorm options

view details

push time in 3 months

push eventKononnable/typeorm

Kononnable

commit sha 9a04a98160f6e7883ed34a0ca375b38d406785ac

mongodb typings

view details

push time in 3 months

push eventKononnable/typeorm

Kononnable

commit sha 415e08c9d747c7f52ad0031c55feec9f646f628a

failing web example

view details

push time in 3 months

push eventKononnable/typeorm

Kononnable

commit sha f47bcd73f4316ffe7814305c2b3b7e2253e9a9b7

failing web example

view details

push time in 3 months

push eventKononnable/typeorm

Kononnable

commit sha 05533f0a1544407f4522e075f43d2cc252e23f1c

failing web example

view details

push time in 3 months

push eventKononnable/typeorm

Kononnable

commit sha 7b3886200f665bb11d00c1781dfd39113b65645b

typescript example

view details

push time in 3 months

push eventKononnable/typeorm

Kononnable

commit sha 9d8b380925b6f75fea775f6697b7ddb4c962e2c7

proper error messages for electron example

view details

push time in 3 months

push eventKononnable/typeorm

Kononnable

commit sha 08050876aa9008b920194079bb3b8df5aa15905e

fix CI builds

view details

push time in 3 months

push eventKononnable/typeorm

Kononnable

commit sha 0ef8003a18f64ce5f7614f090d73ef51a80269a2

fix CI builds

view details

push time in 3 months

push eventKononnable/typeorm

Kononnable

commit sha 31fa4b3f928300b1df69551ca0d4a1f5d58a2254

fix circleci build

view details

push time in 3 months

push eventKononnable/typeorm

Kononnable

commit sha cab0ccd22820358175d762ad9de7dffe9c0b4e06

add electron test project

view details

push time in 3 months

push eventKononnable/typeorm

Kononnable

commit sha 4090376985698c5c8f142f8d77950f9f72d239c0

add electron test project

view details

push time in 3 months

push eventKononnable/typeorm

Kononnable

commit sha 9bb1e951904f9e8dfc9b6e7f7e1c8056e68bd569

add electron test project

view details

push time in 3 months

push eventKononnable/typeorm

Kononnable

commit sha e9f858e143ca50db31afda39584e50e7760ef62d

add electron test project

view details

push time in 3 months

issue commentKononnable/typeorm-model-generator

Case issue: Index.ts fails on Linux, works on Mac OS

Sorry for the delay I didn't have much time for OSS lately. What do you mean by That fails on production? How does that fail?

queejie

comment created time in 3 months

issue commentKononnable/typeorm-model-generator

Can I set entity database name in console options?

Sorry for the delay I didn't have much time for OSS lately. Did you solve the problem or do you still need help with that?

capinemo

comment created time in 3 months

issue closedKononnable/typeorm-model-generator

State of the project

Unfortunately for last few weeks I didn't have enough free time to be able to spend it on this project(or OSS in general). I just wanted you all to know that this project isn't abandoned and I plan to get back to the issues/PRs once I got some more time(but I don't have a clue when this is gonna happen, might be week, might be month etc.). I think typeorm-model-generator is generally in a good condition, all commonly requested features are there or there is a easy workaround if something isn't working as expected. There are always some things which can be improved. If you encounter such cases for now I suggest customizing behavior using this approach. Customizing behavior for your specific use case(without carrying about compatibility with all available options) should be relatively simple in most of the cases. You can still open new issues/PRs, but be aware that it might take some before I review them.

tl;dr Currently I don't have time for this project, I plan to get back to it in the future.

closed time in 3 months

Kononnable

push eventKononnable/typeorm-model-generator

Paweł Kotarski

commit sha 82c2122bcf4ddf7d54d6bac3b1b8475eb651430c

Create stale.yml

view details

push time in 3 months

push eventKononnable/typeorm-model-generator

Paweł Kotarski

commit sha 6b16608c1eaa36c401919589a99ca632a99c20f9

Delete stale.yml

view details

push time in 3 months

push eventKononnable/typeorm-model-generator

Paweł Kotarski

commit sha cfc04c5dd63e9d700a8f304467a2ce1f3e692cc2

Update stale.yml

view details

push time in 3 months

push eventKononnable/typeorm-model-generator

Paweł Kotarski

commit sha a77cc79a2720b8035311047a69c0f44e85d67301

Create stale.yml Stale issue action test

view details

push time in 3 months

issue commentKononnable/typeorm-model-generator

Use custom abstract class

I can mark this issue as an enhancement but I don't think it will be implemented any time soon.

.mst files are used by handlebars template engine. https://handlebarsjs.com/

ivawzh

comment created time in 3 months

issue commentKononnable/typeorm-model-generator

Cannot set property EntityManager of #<Object> which has only a getter

Sorry for the delay I didn't have much time for OSS lately. Could you add something which would allow others to reproduce the issue? DDL statements, database backup etc.

sgentile

comment created time in 3 months

issue commentKononnable/typeorm-model-generator

Login with Windows Active Directory

msnodesqlv8 isn't supported by typeorm-model-generator nor by typeorm.

RW-DiefBell

comment created time in 3 months

issue commentKononnable/typeorm-model-generator

Install package

Sorry for the delay I didn't have much time for OSS lately. This isn't directly related with typeorm-model-generator. Looks like one of it dependencies fails to build because lack of file permissions. It might be related to using sudo with npm. It often leads to many file privileges errors. I would encourage you to change your node installation that it won't require sudo to install global packages. As for other workarounds I would suggest giving full permissions to blocked path to current user or trying to use npx/installing package locally instead of installing it globally.

anhvan-nguyen

comment created time in 3 months

issue commentKononnable/typeorm-model-generator

Unexpected token

Could you add something which would allow others to reproduce the issue? DDL statements, database backup etc.

apiel

comment created time in 3 months

issue commentKononnable/typeorm-model-generator

snake_case for properites

You should look for case-property setting.

sursma

comment created time in 3 months

issue commentKononnable/typeorm-model-generator

Use custom abstract class

No, such functionality isn't implemented. The easiest way to achieve what you want would be to replace BaseEntity in your entities through your IDE(or make simple pipeline around typeorm-model-generator). As for implementing such functionality inside this library - it wouldn't be that easy. You can use named export, or named export etc.

ivawzh

comment created time in 3 months

issue closedKononnable/typeorm-model-generator

connect ECONNREFUSED 127.0.0.1:3308

I am unable to run typeorm-model-generator from within one Docker Container to call a MySQL server that is running in another Docker Container.

I have a docker-compose.yml file that looks like this:

version: '3'

services:
    
    mysql-development:
        image: mysql:8.0.17
        environment:
            MYSQL_ROOT_PASSWORD: helloworld
            MYSQL_DATABASE: testapp
        ports:
        - "3308:3306"
        
    admin:    
        image: adminer    
        ports:      
        - "8080:8080"
   

I then run docker-compose up and it starts up the container.

I can connect by opening a browser and going to localhost:8080

image

I had tried to avoid installing anything locally but in the end I decided to install MySQL Workbench locally to check - and that connects correctly too: image

Once connected, I can run SQL scripts like this:

CREATE TABLE school (
 SchoolId INT NOT NULL AUTO_INCREMENT,
 Name VARCHAR(85) NOT NULL,
 PRIMARY KEY (SchoolId));

and

select * from school

My local development is done using Visual Studio, developing in a dev container. I create a folder for my development ( /sampleapp ) and in that folder I create a subfolder called .devcontainer. In .devcontainer I have two files:

devcontainer.json

// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.107.0/containers/typescript-node-12
{
	"name": "Visual Studio Code Remote Containers",
	"dockerFile": "Dockerfile",

	// Use 'appPort' to create a container with published ports. If the port isn't working, be sure
    // your server accepts connections from all interfaces (0.0.0.0 or '*'), not just localhost.
	"appPort": [3080],
	
    // Comment out the next line to run as root instead.
    "remoteUser": "node",

    // Use 'settings' to set *default* container specific settings.json values on container create. 
    // You can edit these settings after create using File > Preferences > Settings > Remote.
	"settings": { 
		"terminal.integrated.shell.linux": "/bin/zsh"
	},

    // Specifies a command that should be run after the container has been created.
    "postCreateCommand": "yarn install",

	// Add the IDs of extensions you want installed when the container is created.
	"extensions": [
		"dbaeumer.vscode-eslint",
       	// Chrome debugger
		"msjsdiag.debugger-for-chrome",
		"ms-vscode.vscode-typescript-tslint-plugin",
		"CoenraadS.bracket-pair-colorizer",
		"Tyriar.sort-lines",
		"Orta.vscode-jest"
 	]

	// Use 'forwardPorts' to make a list of ports inside the container available locally.
	// "forwardPorts": [3070]
}

Dockerfile - consists of just one line:

FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-12

I open Visual Studio and (following https://code.visualstudio.com/docs/remote/containers) I use the Visual Studio Code Remote - Containers extension to open that /sampleapp folder in a container.

In Visual Studio, I open a new Terminal window and try to run

npx typeorm-model-generator -h localhost -p 3308 -d testapp -u root -x helloworld -e mysql -o .

but I get the error message: connect ECONNREFUSED 127.0.0.1:3308

I have tried changing localhost to 0.0.0.0 but to no avail either.

closed time in 3 months

Coachware-Admin

issue closedKononnable/typeorm-model-generator

[MSSQL] Fail to connect and no message

When I try to connect it stays with this text, it doesn't show anything else.

typeorm-model-generator@0.4.2
[8:03:54] Starting creation of model classes.
tedious deprecated The default value for `config.options.enableArithAbort` will change from `false` to `true` in the next major version of `tedious`. Set the value to `true` or `false` explicitly to silence this message. ..\AppData\Roaming\npm\node_modules\typeorm-model-generator\node_modules\mssql\lib\tedious\connection-pool.js:61:23

closed time in 3 months

Jacen

pull request commentKononnable/typeorm-model-generator

Fixed columns order in generated indexes decorators

Sorry for the delay I didn't have much time for OSS lately. Could you provide reproduction data(e.g. DDL statements) for situation when current approach fails? It would allow me to add a test to make sure that this won't be broken in the future and make sure that implementation is as general as possible(doesn't break other config options).

capinemo

comment created time in 3 months

pull request commentKononnable/typeorm-model-generator

Fixed generated column defaul value

Sorry for the delay I didn't have much time for OSS lately. Could you provide reproduction data(e.g. DDL statements) for situation when current approach fails? It would allow me to add a test to make sure that this won't be broken in the future and make sure that implementation is as general as possible(doesn't break other config options).

capinemo

comment created time in 3 months

pull request commentKononnable/typeorm-model-generator

Checks if schema is defined and use it in typeorm PK name generation

Sorry for the delay I didn't have much time for OSS lately. Could you provide reproduction data(e.g. DDL statements) for situation when current approach fails? It would allow me to add a test to make sure that this won't be broken in the future and make sure that implementation is as general as possible(doesn't break other config options).

capinemo

comment created time in 3 months

push eventKononnable/typeorm-model-generator

Allan Amstadt

commit sha afe212e49bbbef3f1061009433e671e39a97caba

fix(package): Fixed Bug where mssql Driver IsIdentity is not working with non dbo schemas

view details

Paweł Kotarski

commit sha 194c5e502b6fec60c52fa0a3b6244aea69de3f10

Merge pull request #275 from iteufel/master Fixed Bug where mssql Driver IsIdentity is not working with none dbo schemas

view details

push time in 3 months

PR merged Kononnable/typeorm-model-generator

Fixed Bug where mssql Driver IsIdentity is not working with none dbo schemas

Fixed Bug where mssql Driver IsIdentity is not working with none dbo schemas.

+1 -1

0 comment

2 changed files

iteufel

pr closed time in 3 months

PR closed Kononnable/typeorm-model-generator

Add a 'smart' choice to the --strictMode option

I am a new user of this awesome tool (and of typeorm as well). I use strictMode and I had a hard time choosing what I should use between ? (optionnal) and ! (non-null).

I am real new to typeorm so I could be totally wrong in my understanding of all this, but there are my thoughts:

  • When a column has a default value set, then it makes sense to being able to avoid this when creating the associated entity before a save for example

The --strictMode smart option makes class member optional or non-null based on the presence of a default value on the associated db column

  • But then, still, you would have a typing issue with the primary auto-generated keys that should be optional as well to allow creating a new entity, leaving to the database the work of generating it. What do you think ? Should be pretty straightforward to add.
  • smart might not be the good word here, I let you tell me how you would name it

Anyways, I hope to have your insights on this one as I could have misjudge the way people use typeorm with strict mode.

+72 -7

2 comments

5 changed files

toniopelo

pr closed time in 3 months

pull request commentKononnable/typeorm-model-generator

Add a 'smart' choice to the --strictMode option

Sorry for the delay I didn't have much time for OSS lately. First of all: strict mode is completely unrelated to column default value. This setting is required because typeorm is incompatible with typescript strict flag(strictPropertyInitialization to be exact). Typescript strict rules requires all of the fields to be initialized on class initialization(unless field is allowed to contain undefined value). Typeorm doesn't enforce that rule. In most cases each entity returned from typeorm will have all of the fields filled with data but you can make it skip fetching some columns from db(select:false in column option decorator or passed directly to query builder). If you disable any column typescript will think that there is a proper value in such property while value in runtime will be set to undefined(because typeorm didn't fetch it from db). In order to make typeorm models compatible with typescript strict mode we have to add ? at the end of property name. It means that this property can contain undefined value. However this makes entity models much harder to use because every time we access that property we have to manually check if value is not set to undefined. Because of that inconvenience some people prefer to use !. They tell the compiler that every field will be initialized before it is used. It's true in most of the cases, but not all of them(select:false) and it's now their responsibility(not the compiler) to worry about that minority of cases.

toniopelo

comment created time in 3 months

PR closed Kononnable/typeorm-model-generator

Add graphql ability

This is a super WIP, and has no tests, but it would be nice if this could generate Graphql ready models. I'm using this in a side project, so would be great to hear what you think of this.

+126 -12

1 comment

8 changed files

cellis

pr closed time in 3 months

pull request commentKononnable/typeorm-model-generator

Add graphql ability

Sorry for the delay I didn't have much time for OSS lately. Unfortunately I don't think this PR should be merged. You could create your own library which would add support for type-graphql to typeorm models. It looks like simple parsing of lines with typeorm decorators should be enough and it could be used in more use cases(to add type-graphql support even if you're using code-first approach). Reasons I don't want this functionality to be part of this library:

  • I don't like the idea of automatic generation of public api based on database model. Yes, it can be faster, easier to do, but it's a security hazard. Not all of the tables/fields should be exposed to the api(e.g. password fields). By default we generate every table, every field and most users will just use it as is, without looking on security. We often don't have enough time for development so if something is working as expected we just leave it as is, without thinking if we actually need every bit of code or if it can be a security vunerability.
  • There are multiple libraries for graphql which means that we would have to support other libraries soon or promote a single library. This would require a lot of work for a feature which is outside of direct package scope(generating models for typeorm).
cellis

comment created time in 3 months

more