Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking Changes Tracker #19

Open
kndndrj opened this issue May 25, 2023 · 6 comments
Open

Breaking Changes Tracker #19

kndndrj opened this issue May 25, 2023 · 6 comments

Comments

@kndndrj
Copy link
Owner

kndndrj commented May 25, 2023

No description provided.

@kndndrj
Copy link
Owner Author

kndndrj commented May 25, 2023

Here is the first set of breaking changes introduced with #9:

  • config.connections is deprecated and replaced with config.sources if you
    used this to specify your connections just replace this:

    {
      connections = {
        -- ...
      }
    }

    with this:

    {
      sources = {
        require("dbee.sources").MemorySource:new({
          -- ...
        },
      },
    }
  • config.result.window_command -> config.ui.window_commands.result

  • config.result.page_size -> config.page_size

  • config.drawer.window_command -> config.ui.window_commands.drawer

  • config.drawer.mappings.action_2 default da -> cw

  • config.drawer.mappings.collapse now disabled by default

  • config.drawer.mappings.expand now disabled by default

  • config.drawer.disable_icons -> config.drawer.disable_candies

  • config.drawer.icons -> config.drawer.candies

  • config.drawer.icons.*.highlight -> config.drawer.candies.*.icon_highlight

  • config.editor.window_command -> config.ui.window_commands.editor

@kndndrj kndndrj pinned this issue May 25, 2023
@kndndrj
Copy link
Owner Author

kndndrj commented Aug 14, 2023

require"dbee".save() is deprecated and replaced by require"dbee".store()

require"dbee".save(format, file)
-- is the same as
require"dbee".store(format, "file", { extra_arg = file })

@kndndrj
Copy link
Owner Author

kndndrj commented Dec 28, 2023

A refactor is happening on refactor/first branch. It will be merged once some testing is done.
Any feedback would be appreciated.

@kndndrj
Copy link
Owner Author

kndndrj commented Dec 29, 2023

Breaking changes introduced with #55 :

  • config.extra_helpers variables changed to go template syntax (from {table} to {{ .Table }}) - see default config for more

  • config.page_size -> config.result.page_size

  • require"dbee.spinners" removed

  • config.progress_bar -> config.result.progress

  • config.progress_bar.icon -> config.result.progress.spinner

  • ALL MAPPINGS:
    action = { key = "key", mode = "mode" } -> { key = "key", mode = "mode", action = "action" }

  • config.ui -> config.window_layout:
    the whole ui config section is deprecated and layout interface is used instead.

  • connection environment variable syntax changed to go template function syntax: {{ env.VARIABLE }} -> {{ env "VARIABLE" }} or {{ env `VARIABLE` }}.

@kndndrj
Copy link
Owner Author

kndndrj commented Apr 9, 2024

Breaking changes in #82:

default connection spec file location changes from vim.fn.stdpath("cache") to vim.fn.stdpath("state").

Add this to your config to keep the previous behaviour:

{
  sources = {
 
   require("dbee.sources").FileSource:new(vim.fn.stdpath("cache") .. "/dbee/persistence.json"),
  },
}

@kndndrj
Copy link
Owner Author

kndndrj commented Apr 22, 2024

breaking changes in #98:

  • layout contract changed
-- from this:
---@class Layout
---@field open fun(self: Layout, uis: layout_uis) function to open ui.
---@field close fun(self: Layout) function to close ui.

-- to this:
---@class Layout
---@field is_open fun(self: Layout):boolean function that returns the state of ui.
---@field open fun(self: Layout) function to open ui.
---@field close fun(self: Layout) function to close ui.
  • source contract changed
-- from this:
---@class Source
---@field name fun(self: Source):string function to return the name of the source
---@field load fun(self: Source):ConnectionParams[] function to load connections from external source
---@field save? fun(self: Source, conns: ConnectionParams[], action: source_save_action) function to save connections to external source (optional)
---@field file? fun(self: Source):string function which returns a source file to edit (optional)


-- to this:
---@class Source
---@field name fun(self: Source):string function to return the name of the source
---@field load fun(self: Source):ConnectionParams[] function to load connections from external source
---@field create? fun(self: Source, details: ConnectionParams):connection_id create a connection and return its id (optional)
---@field delete? fun(self: Source, id: connection_id) delete a connection from its id (optional)
---@field update? fun(self: Source, id: connection_id, details: ConnectionParams) update provided connection (optional)
---@field file? fun(self: Source):string function which returns a source file to edit (optional)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant