Been playing a lot with #SurrealDB on #RustLang with #Axum and #Handlebars_rs
My #PrayerOfHannah app on #CodeBerg at https://codeberg.org/Dave42W/PrayerOfHannah now has working #CRUD for SongBooks and Authors using the embedded file db engine which is #RocksDB under the covers.
Starting to get to a more productive place.
#surrealdb #rustlang #axum #handlebars_rs #prayerofhannah #codeberg #crud #rocksdb
I keep putting off doing docs and tests 😉
But I now have full CRUD for my first table.
I had some difficulties using the PATCH method on my edit form, it wasn't routing as I expected, so updates use POST to a different route.
I need
- some better passing db errors to the user
- a delete confirmation
- checking for multi-user db changes
- transactions
- after insert/update/delete I should redirect to the list not simply call the method as the url is wrong.
#RustLang #Axum #SeaOrm #Handlebars_rs
#rustlang #axum #seaorm #handlebars_rs
Very excited. I have the parts working together for an incredibly, basic #RustLang web app. Using #Axum #Handlebars_rs #SeaOrm with #Sqlite all on #CodeBerg at https://codeberg.org/Dave42W/daves_dashboard
I've tidied the code and massively simplified it.
Getting to the point where I have a working environment to start building #PrayerOfHannah .
I do want to add doc strings, and tests so this becomes the simplest possible example of all the connections for a CRUD web app.
#rustlang #axum #handlebars_rs #seaorm #sqlite #codeberg #prayerofhannah
Close but struggling to connect #SeaOrm entities to #Axum handlers, I want get Json from the entity for rendering html with #Handlebars_rs ) and I want to get extracted form into entity struct so I can insert into database.
Caught in a mismatch of types and traits and funding the docs & examples either don't work or very confusing.
#RustLang learning curve is steep again.
#seaorm #axum #handlebars_rs #rustlang
Made good #RustLang progress this evening, no longer spending hours trying to understand compiler errors 😊
Working on my learning project "Daves Dashboard" code on #CodeBerg at https://codeberg.org/Dave42W/daves_dashboard
I've got #Axum #Handlebars_rs (including first partial template) and #SeaOrm working together neatly. Was a lot of setup for migrations but now also have autogenerated entity.
Next connect my model to the database using entity.
#rustlang #codeberg #axum #handlebars_rs #seaorm
I've realised that my #RustLan problem isn't #Handlebars_rs but that I need to work with #Axum to set the Response content type. So that is leading me to both Axum State and intoResponse.
Starting to dream about exciting projects that #Rust is going to be great for.
While the strict compiler, types and syntax give a steep learning curve I like the feeling of confidence that they give once you get past them. Fewer runtime surprises.
#rustlan #handlebars_rs #axum #rust
Happy progress on my #RustLang learning project using #Axum #Handlebars_rs and now #dotenvy
on #GitHub at https://github.com/dave42w/daves_dashboard
I now have my first template file being rendered with nice, clean model and view implementations.
Three issues of which two will be solved by learning #Closures
details of those in the thread.
#rustlang #axum #handlebars_rs #dotenvy #GitHub #closures
Stuck on #Rust #json #Handlebars_rs
// I want this to get the data as JSON, then render using a template into a String
pub fn sys_info_template(j: Json<SysInfo>) -> String {
let hbr = Handlebars::new();
let source = "system_name {{system_name}}";
hbr.register_template_string("t1", source);
hbr.render("t1", &j).unwrap()
}
The &j is giving Serialize is not satisfied. Json<SysInfo> is in next post.
I didn't think I needed a custom serializer for a struct of Strings
Got my first #JSON appearing in a web browser. Still a huge amount to understand about #RustLang scoping and types.
Next step is #Handlebars_rs templating :-)
#json #rustlang #handlebars_rs
A little #RustLang update.
1. I'm now Dave42W on GitHub to match everywhere else.
2. My learning project "daves-dashboard" is at https://github.com/dave42w/daves_dashboard
3. I've started an #Axum branch for the web framework
4. I'll be using #Handlebars_rs for templating (it works with Rust inside the browser too)
5. Some cool new #VSCode extensions #Crates #Better_TOML #Error_Lens #Thunder_Client should help with #Rust complexities
6. I want to look at #YAW for the client end in the future
#rustlang #axum #handlebars_rs #vscode #crates #better_toml #error_lens #thunder_client #rust #yaw