fbucek / sqlxinsert

MIT License
18 stars 9 forks source link

cannot recreate example #1

Closed paul-asvb closed 1 year ago

paul-asvb commented 3 years ago

I tried to recreate the sample: https://github.com/paul-asvb/rust-sqlxinsert

i get a Error: error returned from database: relation "cars" does not exist

Not sure how to use it. Disclaimer new to rust so might be a noob mistake.

fbucek commented 3 years ago

The Example assumes, that there is a defined table cars with 3 columns id, name, and color.

I suggest to look into simple example of sqlx project, where is part with table creation using smart tool migration. There is also a smart insert without manually binding each column.

https://github.com/launchbadge/sqlx/tree/master/examples/postgres/json