Closed yingweixiang closed 3 days ago
Well that is one of several possibilities to create a CRUD interface.
What error do you get when you try to compile?
Also when you really don't know programming then I wouldn't recommend using Rust as your first programming language. It is awesome but has a steep initial learning curve.
Maybe start with Python or JavaScript instead.
Thanks for your advice, I'll think about Python.
I create a Struct with a variable named "created_at", corresponding to a column "created_at" (data type: timestamp) in postgres SQL. however, I couldn't compile it in rust. I used the exmaple "serverfn_sqlx", just changed the databese and Struct . The original "serverfn_sqlx" example works well.
BTW, it would be better to have an example showing 2 sections on the webpage: (like CRUD with javascript) top section--- insert a new record into a table inside SQL database.
bottom section --- showing table records, automatically referesh after a new record being inserted into the table. (create a resource ? )
I could use server action to get table records, but don't know how to implement 'TableDataProvider'. (I'm a non-IT guy)
Thanks. Yingwei