Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

I am looking into solutions for a two-mode OSS app, a SvelteKit website that can be hosted with (Node.js) and without (Static files) a server. Triplit looks perfect for this, but its documentation does not mention how one could use triplit seed on a local-only database for the latter usecase. Can you do that, or would I need to import the seed file myself?

You must be logged in to vote

You would like to seed a client side/on device database, correct? In this case, you can run a transaction on startup and probably save an indicator that the data has been seeded. If the data will never sync, you might be able to use @triplit/db instead of @triplit/client.

If that's not what you're looking to do can you please expand upon your use case?

Replies: 1 comment · 2 replies

Comment options

You would like to seed a client side/on device database, correct? In this case, you can run a transaction on startup and probably save an indicator that the data has been seeded. If the data will never sync, you might be able to use @triplit/db instead of @triplit/client.

If that's not what you're looking to do can you please expand upon your use case?

You must be logged in to vote
2 replies
@MrVauxs
Comment options

Pretty much. The goal is to have two versions of the same software for those who want it hosted as a static website instead of a fully-fledged backend.

By the sound of it looks like I will need to do the seeding myself then. That's fine.

Can you elaborate on using /db package instead of /client though? I cannot find anything about that package.

@wernst
Comment options

@triplit/db is more like a local (possibly persistent) state manager, which is used by @triplit/client under the hood and has a very similar API.

However if the app is doing anything beyond saving data locally for either site (ie data must be saved in a remote database and synced to other users), you should use @triplit/client

Answer selected by MrVauxs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.