onyxframework / sql

A delightful SQL ORM ☺️
https://api.onyxframework.com/sql
MIT License
91 stars 7 forks source link

Better handle inserting empty models cases #66

Open vladfaust opened 5 years ago

vladfaust commented 5 years ago

Either change the error message from

Cannot append empty INSERT values. Ensure to call #insert before. Or if you want to insert all columns default, use 'INSERT INTO table DEFAULT VALUES' SQL query instead

to

Cannot append empty INSERT values. Ensure to call #insert before. Or if you want to insert a empty model or a model with all default values, use 'INSERT INTO table DEFAULT VALUES' SQL query instead

or allow to insert empty models.