silverqx / TinyORM

Modern C++ ORM library
https://www.tinyorm.org
MIT License
242 stars 25 forks source link

Is there an interface to create tables? #2

Closed zynfly closed 2 years ago

zynfly commented 2 years ago

can generate table creation statements or generate new data tables directly from the model

silverqx commented 2 years ago

No, the query builder or model doesn't have any DDL-related methods. And also any migrations for now.

Database tables for tests are generated with PHP script here by help with Laravel's Schema builder.

silverqx commented 2 years ago

I'm personally creating tables with phpmyadmin or with Laravel schema builder for my personal usage, but would be amazing to have also schema builder in TinyOrm.

zynfly commented 2 years ago

Can I use TinyOrm to execute my own table creation statement?

zynfly commented 2 years ago

TinyOrm looks like a great library. I tried it for the first time today. Now I don't know how to use it to create tables.

silverqx commented 2 years ago

Yes, you can use DB::statement() or DB::unprepared(), also described in docs.

zynfly commented 2 years ago

Thanks! The table has been created.

silverqx commented 2 years ago

I have added Schema builder for MySQL db, only one thing that is not implemented is updating database columns. 😁😎 @zynfly

zynfly commented 2 years ago

I'll try it now. It looks very cool.

silverqx commented 2 years ago

I have released tom migrations; commit, here are docs and how to build docs. @zynfly

I think that it's all I will add related to the DDL, maybe the seeder in the future 😎.

Here are some images how the tom migrations looks like:

tom_list

tom_migrate_rollback_inspire

tom_migrate_status_1

Happy migrating 🎉👌

zynfly commented 2 years ago

This is really great. It has become more and more perfect.