typeorm-seeding icon indicating copy to clipboard operation
typeorm-seeding copied to clipboard

Generate SQL commands

Open gerwinbrunner opened this issue 2 years ago • 1 comments

Is there a way to generate a SQL file of all the commands instead of running them directly in the db? Something like the SCHEMA file that RubyOnRails creates.

We are trying to improve the speed of DB preparation for automated testing. Currently the seed takes >1min to run. So If we could generate the SQL in an upfront step, then we could potentially save some time (30sec)

Any idea how this could be done.

gerwinbrunner avatar May 16 '23 12:05 gerwinbrunner

Probably what you are looking for should be on TypeORM (synchronize option), probably generating all the schema at once that could be done with a simple command.

If your problem is that you already have the schema and need the seeding on SQL, I'm sorry, but the library currently doesn't have any functionality like that (and don't expect in short term, I'm out of time).

jorgebodega avatar May 17 '23 09:05 jorgebodega