Dave Warnock · @Dave42W
311 followers · 1383 posts · Server amastodon.uk

Been playing a lot with on with and
My app on at codeberg.org/Dave42W/PrayerOfH now has working for SongBooks and Authors using the embedded file db engine which is under the covers.
Starting to get to a more productive place.

#surrealdb #rustlang #axum #handlebars_rs #prayerofhannah #codeberg #crud #rocksdb

Last updated 3 years ago

Dave Warnock · @Dave42W
297 followers · 1185 posts · Server amastodon.uk

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

Last updated 3 years ago

Dave Warnock · @Dave42W
297 followers · 1178 posts · Server amastodon.uk

Very excited. I have the parts working together for an incredibly, basic web app. Using with all on at codeberg.org/Dave42W/daves_das
I've tidied the code and massively simplified it.
Getting to the point where I have a working environment to start building .
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

Last updated 3 years ago

Dave Warnock · @Dave42W
290 followers · 1090 posts · Server amastodon.uk

Close but struggling to connect entities to handlers, I want get Json from the entity for rendering html with ) 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.
learning curve is steep again.

#seaorm #axum #handlebars_rs #rustlang

Last updated 3 years ago

Dave Warnock · @Dave42W
287 followers · 1074 posts · Server amastodon.uk

Made good progress this evening, no longer spending hours trying to understand compiler errors 😊
Working on my learning project "Daves Dashboard" code on at codeberg.org/Dave42W/daves_das
I've got (including first partial template) and 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

Last updated 3 years ago

Dave Warnock · @Dave42W
280 followers · 904 posts · Server amastodon.uk

I've realised that my problem isn't but that I need to work with to set the Response content type. So that is leading me to both Axum State and intoResponse.
Starting to dream about exciting projects that 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

Last updated 3 years ago

Dave Warnock · @Dave42W
279 followers · 886 posts · Server amastodon.uk

Happy progress on my learning project using and now
on at github.com/dave42w/daves_dashb

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

details of those in the thread.

#rustlang #axum #handlebars_rs #dotenvy #GitHub #closures

Last updated 3 years ago

Dave Warnock · @Dave42W
278 followers · 851 posts · Server amastodon.uk

Stuck on

// 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

#rust #json #handlebars_rs

Last updated 3 years ago

Dave Warnock · @Dave42W
278 followers · 837 posts · Server amastodon.uk

Got my first appearing in a web browser. Still a huge amount to understand about scoping and types.
Next step is templating :-)

#json #rustlang #handlebars_rs

Last updated 3 years ago

Dave Warnock · @Dave42W
273 followers · 807 posts · Server amastodon.uk

A little update.
1. I'm now Dave42W on GitHub to match everywhere else.
2. My learning project "daves-dashboard" is at github.com/dave42w/daves_dashb
3. I've started an branch for the web framework
4. I'll be using for templating (it works with Rust inside the browser too)
5. Some cool new extensions should help with complexities
6. I want to look at for the client end in the future

#rustlang #axum #handlebars_rs #vscode #crates #better_toml #error_lens #thunder_client #rust #yaw

Last updated 3 years ago