Live data from Hacker News

Pocketbase: Open-source back end in one file

pocketbase.io

101–110 of 151 posts

Re: Pocketbase: Open-source back end in one file

#101
post #66

I feel like this will be super interesting when pairing with static site generator such as eleventy. Using static site generator is sometimes difficult because of lacking a web backend and ghost is too heavy for me.

Could you explain a bit more this setup? I have been looking for a way to have a tool to fill pages for a static site generator that's local and then just git push in a simplified way.

The idea is to create a website for my mother, without having to deal with hosting at all (static github pages).

Does this combination work that way?

Re: Pocketbase: Open-source back end in one file

#104

How are database migrations handled in this? Ive never understood how BaaSes are to be used when I need to add a new column to my table and do some inserts into it in the same migration

A lot of these tools just abstract away migrations. But I do know some like Supabase let you clone a copy locally and manually perform migrations if you see fit

Re: Pocketbase: Open-source back end in one file

#106

I like the idea, but after using it, the query apis aren't expressive enough. I wish I could write SQL instead of making 2+ api calls to get the data I want.

I'm no expert, but it seems like raw SQL is supported. From the docs:

"It also exposes app.Dao().DB() builder that allows executing various SQL statements (including raw queries)."

Re: Pocketbase: Open-source back end in one file

#109
I've been developing on PocketBase for 2 months. The system goes into production in 1 to 2 months.

I'm exceptionally happy with it. I'm developing an webapp for a friend's company and wanted a very simple system to hand-off. The whole thing is running with one binary: Pocketbase. It runs a webserver, server-side Javascript (compiled TypeScript) code, and SQLite database. The single process is hosted on Vultr for $12 per month. My frontend is written in SvelteKit (static adapter) + Svelte + TypeScript.

Pocketbase is well done. The author has been exceptionally responsive to my questions. He is fast and clear.

I have had a few minor issues: The documentation has bare spots (but is very good for most things). I had to write my own CSV loader. (I hope to open-source it.) Writing lots of objects through the CRUD interface is slow. (It's possible to write faster using server-side code.) Unit testing for the server-side JavaScript had to be shoehorned in. And I wish Copilot/ChatGPT could answer questions better. But these issues have been minor, given all my work on the project.

It has some quirks. There's no way to set the 404 page on the webserver. And the binary's location in the filesystem matters. It was designed for the author's use and you have to live with these choices.

As I said, I've been happy using it. It fit my needs exactly: simple and I could code everything in one language, TypeScript. Pocketbase is not high-performance, but I didn't need that. I've had a few ideas for side projects and, when I'm done this work, I'll implement one on Pocketbase because it is that easy.

And, as part of my contract, my friend's company will donate to Pocketbase. :)

Re: Pocketbase: Open-source back end in one file

#110
post #106

I like the idea, but after using it, the query apis aren't expressive enough. I wish I could write SQL instead of making 2+ api calls to get the data I want.

I'm no expert, but it seems like raw SQL is supported. From the docs: "It also exposes app.Dao().DB() builder that allows executing various SQL statements (including raw queries)."

Yes, that's correct. In server-side code, you can write SQL queries.

JavaScript API: https://pocketbase.io/docs/js-database/ Go API: https://pocketbase.io/docs/go-database/

Post reply on HN