sqlite.lua icon indicating copy to clipboard operation
sqlite.lua copied to clipboard

:sparkles: index access

Open kkharji opened this issue 2 years ago • 1 comments

Purpose

Make it possible to access sqlite.tbl operations using index access:

for example:

local kvtable = tbl("kvtable", {
  key = { "text", primary = true, required = true, unique = true },
  value = "integer",
}, db)

--- access/insert-to/remove using primary key
kvtable.a = { value = 1 }
kvtable.a = nil
--- access/update a row field value 
kvtable.a.value = 2
kvtable.a.value = nil
--- sets a key field value without creating the key first
kvtable["some key with spaces :D"].value = 4

closes #98

kkharji avatar Sep 01 '21 06:09 kkharji

... to be continued sometime next week. reviews are welcomed.

kkharji avatar Sep 02 '21 11:09 kkharji