Giter Site home page Giter Site logo

aspen-cloud / triplit Goto Github PK

View Code? Open in Web Editor NEW
849.0 4.0 25.0 22.37 MB

A full-stack, syncing database that runs on both server and client. Pluggable storage (indexeddb, sqlite, durable objects), syncs over websockets, and works with your favorite framework (React, Solid, Vue, Svelte).

Home Page: https://triplit.dev

License: GNU Affero General Public License v3.0

JavaScript 1.35% TypeScript 90.35% MDX 8.04% HTML 0.04% CSS 0.22%
crdt database firestore fullstack multiplayer supabase bun cloudflare-workers deno durable-objects

triplit's People

Contributors

armincerf avatar github-actions[bot] avatar honeymaro avatar i-am-henri avatar matlin avatar pbohlman avatar simonbukin avatar wernst avatar wonderpanda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

triplit's Issues

Include or export utilities for query building

Certain APIs dont have easily accessible query builders. They dont really use a lot of state, so we could export them to make them accessible. Or add a query api to RemoteClient and other utilities without query building capabilities.

Deletes do not sync to disconnected clients

Reproduction:

  • Run a client with persistent storage, get it in sync with the server
  • Take the client offline
  • Perform a delete (remotely from a different connected client)
  • Take the client back online, the deletion does not sync to the client

Native Mobile Support

Feel free to close this issue if this is documented somewhere and I missed it. I like the idea here but I found nothing about android support. Is the idea that if you want mobile app support that you should use react native? That's not an option for me but it would be very nice to have some sort of integration with Compose / modern android primitives.

chat template: `Missing required params: [token]. Skipping sync connection.`

Hi folks! I'm trying to setup the chat example locally on my machine. I followed all the steps in the README, including making a github app and filling in the details in .env. On running the app, I get this warning in my console:

image

And in the triplit terminal, I see this:
image

Because of which (I think) I'm not seeing any syncing across browsers. Do you folks have any pointers for how I can get this working? Thank you!

Codegen cannot handle kebab-case collection names

Reproduction:

  • Create a collection on remote with a kebab-case name
  • Run triplit migrate pull
  • Codegen fails

This appears to be a general issue that keys need to be wrapped in strings before prettifying them in the codegen process

Request: addative query builder api

Currently the query builder will overwrite values if the same method is used twice. For example client.query('todos').where(['completed', '=', true]).where('author', '=', 'alice') will just include the second where clause. An api like this could be preferred to many filter tuples in a single where statement, and also lets you define a base query with a filter in a variable then append to the where clause later.

There are some complicated edits you could make to a query's filters if the filter is deep and complex (ie deep ands / ors), so we'd need to figure out if/how the api would handle that.

Add tools to aid with seeding the db with data

Just jotting down some ideas here, am happy to edit this issue to refine/exclude anything you think shouldn't be in scope for this project.

  • Import data from file via the console (csv/json etc)
  • Import via cli
  • Add seed files in whatever format to a folder on the machine hosting the server, on startup the server applies those transactions if they are new (ala the many tools available for RDMS systems)

Make connection errors more accessible

Although I can hook into the connection state, I don't have much information as to WHY a client cannot connect.

For example, I may have a malformed connection token, but have no way to pull this specific error information out of the client or react packages.

Without providing this, the app can really only inform the user the app is disconnected, but not what it could do about it (or if it expects that it may be able to reconnect).

IndexedDbStorage missing idb dependency

When using the IndexedDbStorage provider it appears a dependency to 'idb' is missing

import { IndexedDbStorage } from "@triplit/db/storage/indexed-db";
import { TriplitClient } from "@triplit/client";
const client = new TriplitClient({
  db: {
    storage: {
      client: new IndexedDbStorage("tripchat-client"),
      outbox: new IndexedDbStorage("tripchat-outbox"),
    }
  }
});

At runtime:
ERROR: Could not resolve "idb/with-async-ittr"

Request: dont make me manually migrate my database on each restart during local development

When you run triplit dev your database server starts. Although the storage option is available to specify more persistent storage (like sqlite) it is not the default, instead the database will start with en empty in-memory storage instance.

Because the db starts empty, your migrations aren't tracked on the remote database and that can cause some small issues or features to not run (like authz).

From a pure ux perspective its tough to remember to run these migrations and I have to switch to a different terminal window to run them.

Suggestions:

  • Run your local migrations when starting the triplit dev server
  • When dev runs, if there are unapplied migrations, suggest that i run them
  • larger refactor surrounding how schemas/migrations are applied in local development

Removals from queries arent properly synced when a client connects

It seems based on how we initialize queries when connecting, we may miss updates based on filters.

Reproduction:

  • Set up a subscription to a query with a filter on client A and client B
  • Add some data
  • Take client B offline, mutate data on client A so it is evicted from the query result
  • Bring client B back online, see query result does not contain updates

Remote client fails to infer types based on query and schema

Example:

const client = new RemoteClient({ schema });
const result = await client.fetch({
    collectionName: 'todos',
});

// Result is Map<string, any>

I think we need to properly type the query parameter of fetch (so we can pull out the schema and proper return type) or ensure that happens under the hood of fetch somewhere.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.