Skip to content

Latest commit

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ohm.lua

A port of the popular ohm library to Lua.

example

-- define this in models/user.lualocalohm=require("ohm")
returnohm.model("User", {
attributes= {
"lname",
"fname",
"email"
},
indices= {
"full_name"
},
uniques= {
"email"
}
})
-- using it: (e.g. in app.lua)localuser=require("models/user")
localresp=require("resp")
localattributes= {
email="john@example.org",
fname="John",
lname="Doe",
full_name="John Doe",
}
localdb=resp.new("localhost", 6379)
localid=assert(user:save(db, attributes))
assert("1" ==id)

license

MIT

About

lightweight object mapping for redis

Resources

Stars

13 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages