square-foot / HTMX-FrontEnd

Some frontend examples for productive, rapid use of HTMX
MIT License
6 stars 0 forks source link

Pocketbase connection #1

Open gedw99 opened 1 month ago

gedw99 commented 1 month ago

Very cool !!

Could we add a little more to show it working with pocketbase ? Happy to help :)

I am curious how the toml maps back to a collection in the pb SQLite db .

Maybe add an example of 2 also to help tease out how devs can use it but also any bugs

square-foot commented 2 weeks ago

Sorry, was busy elsewhere. Just saw this... Thank you for your kind words. TOML maps back to JSON (and from JSON back to TOML) using this excellent binary executable: https://github.com/alceal/jty-converter I simply use the $os.exec(...) function in PB to call that TOML converter when needed. I have not tested for scalability, but I think it is just too tiny and so should work fine for most tasks, I guess.

I will get around to making a small test app to showcase this. Unfortunately stuck in a gazillion things.

gedw99 commented 2 weeks ago

Thanks 🙏

I will try that out .

https://github.com/gedw99/goPocJsonSchemaForm is a similar thing I am working on .

have a look . Just go run .

The htmx gui is controlled by 2 json schema files . 1 is for the data from the db . The other is to describe the html form.

You can then build htmx gui where the fields are validated based on the data schema .

the next steps are to reflect if pocketbase at run time to build the json schema .

Anyquery. Is also another on I will use . https://github.com/julien040/anyquery

The changing of data in the source db is then an event . The source dn can be anything . SQLite , Google sheets . Anything