f9326aa sqlite:tbl(...) doesn't pass schema
This what happens with dealing with function that can take self or other.
- 99e4058 fix changelog links
edf642e fix Emmylua completion
This used to work, but maybe with new versions of sumneko_lua. It stopped working.
- 3d89dc1 add Bookmark Manager Example
- 5b39526 activate release workflow
a6bd3d1 sql.schema return detailed description of table.
Not sure if this is a wise decision or not. But it beat having the schema returned given the key and the value the user written.
5b0710f (parser) change nullable to require + refactor
Additionally, make primary reference pk.
8bf61d2 change sugar function namespace to sql.lib
changes access to sugar functions and store it in lib. It was weird typing out
sql...
and abbreviating it seems harder too.
1c88610 extended tables referencing mutable db object + other fixes (#100) (closes #101, #99)
table.extend
reference db object instead ofdb.extend
ed object. this fix issue with calling methods that has been already modified by the user.- remove debug stuff
- modify
table.extend
mechanism. - stop mutating insert/update source data when processing for
sql.insert
2b500b7 each map sort failing due to closed connection
make map, sort, each, support executing sqlite queries regardless of connection status.
- 🐛 func(row) returning nil causing error
- 🐛 running some tbl function without checking conn
-
9173664 changelog run once every two days take 2
4d0302f favor delete/remove accepting where key
No breaking changes here :)
25748dd auto alter table key definition (#103)
Support for modifying schema key definitions without wasting the table content. It has little support for renaming, in fact, renaming should be avoided for the time being.
✨ New:
db:execute
for executing statement without any return.- emmylua classes
SqlSchemaKeyDefinition
andSqliteActions
. - when a key has default, then all the columns with nulls will be replaced with the default.
- support for auto altering key to reference a foreign key.
🐛 Fixes
- when a foreign_keys is enabled on a connection, closing and opening disables it.
♻️ Changes
- rename
db.sqlite_opts
todb.opts
.
✅ Added Tests
- auto alter: simple rename with idetnical number of keys
- auto alter: simple rename with idetnical number of keys with a key turned to be required
- auto alter: more than one rename with idetnical number of keys
- auto alter: more than one rename with idetnical number of keys + default without required = true
- auto alter: transform to foreign key
- auto alter: pass sqlite.org tests
73d8fa6 dot access for extended tbl object (#92)
Changes:
-
Fix parsing schema key when using key value pairs.
-
access tbl original methods after overwrite with appending
_
-
Inject db object later with
set_db
-
auto-completion support
local users = require'sql.table'("users", {...}) -- or require'sql.table'(db, "users", {...}) users.init = function(db) -- if db isn't injected already users.set_db(db) --- inject db object end users.get = function() -- overwriting method return users._get({ where = { id = 1 } })[1].name end return users
-
5944a91 table each and map accept function as first argument (closes #97)
still compatible with query as first argument ✅
Examples:
tbl:each(function(row) .. end) -- execute a function on all table rows tbl:each(function(row) .. end, {...} ) -- execute a function on all table rows match the query -- map work the same way, but return transformed table
- 91b28f6 uncomment leftout tests
2424ea0 (sql) avoid executing sql.schema on crud
follow up to d791f87
a46ee6b (table) avoid executing sql.schema on crud
simple performance enhancement that should have been done from the start :smile:
1a36aa5 sql.extend handling of tables and connection. (#96)
✨ New:
- add usage examples for DB:extend.
- support using different name to access a tbl object
{_name = ".."}
. - support using pre-defined/extended sql.table object.
- 100% lazy sql object setup: No calls will be made before the first sql operation.
♻️ Changes:
- remove init hack of controlling sql extend object table initialization (no longer needed).
- remove old tests.