Skip to content

ratplier/silo

Repository files navigation

silo

an atomic datastore library

install via wally:

silo = "ratplier/silo@1.1.0"

quickstart

const schema = silo.schema {
    coins = 10,
    is_premium = false,
}
const store = silo.store(schema, silo.backends.temporary("player_data"))

store:update("ratplier", function(data)
    if data.coins < 10 then
        return nil
    end

    data.coins -= 10
    data.is_premium = true
    return data
end)

documentation

  • backend - guide to creating custom backends for silo
  • schema - quick explaination on schemas and migration
  • transactions - the rundown on update and tx

api

silo.store(schema, backend)
  • .update(key, transform) - apply an atomic update to a record
  • .tx(callback) - execute multiple updates in a transaction
  • .observe(callback) - subscribe to key changes
  • .view(key) - get a live view object for a key
  • .erase(key) - delete a record
silo.schema(default)
  • .migration(transform) - create a migration for the schema
silo.backends
  • temporary - memory backend for testing
  • datastore - Roblox Datastore backend

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages