Skip to content

Latest commit

 

History

History
257 lines (141 loc) · 11.2 KB

CHANGELOG.md

File metadata and controls

257 lines (141 loc) · 11.2 KB

🐛 Bug Fixes

  • 74b3844 false is treat as nil when inserting (closes #123)
f9326aa sqlite:tbl(...) doesn't pass schema

This what happens with dealing with function that can take self or other.

Refs: AckslD/nvim-neoclip.lua#20

👷 CI Updates

🐛 Bug Fixes

edf642e fix Emmylua completion

This used to work, but maybe with new versions of sumneko_lua. It stopped working.

✨ Features

  • 3d89dc1 add Bookmark Manager Example

🐛 Bug Fixes

43f5e0c luarocks auto-generate script (closes #115)

Having "/" in the start of path breaks luarocks installation.

✨ Features

  • 5b39526 activate release workflow

⚡ Performance Improvements

  • ca8233f improve handling of sqlite builtin functions (closes #114)
f9a1060 improve require time (#111)

decrease require time (cost on startup) from 0.791636 ms to 4.140682 (423% faster)

v1.0.0

🎨 Structure/Formating

💥 Breaking Changes

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.

🐛 Bug Fixes

  • 1778aa8 (parser) only check when type is table (closes #103)
1c88610 extended tables referencing mutable db object + other fixes (#100) (closes #101, #99)
  • table.extend reference db object instead of db.extended 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
  • db026ee using sql functions makes parser setsome values to null (#88) (closes #87)
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

👷 CI Updates

♻️ Code Refactoring

4d0302f favor delete/remove accepting where key

No breaking changes here :)

✨ Features

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 classesSqlSchemaKeyDefinition and SqliteActions.
  • 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 to db.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
88f14bf auto changelog (#80)

Here goes nothing 🤞. Please CI don't fail me.

✅ Add/Update Test Cases

⚡ Performance Improvements

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.