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

Add support for in-memory sqlite db and/or DataDB #147

Closed
arielmelendez opened this issue Oct 11, 2023 · 1 comment
Closed

Add support for in-memory sqlite db and/or DataDB #147

arielmelendez opened this issue Oct 11, 2023 · 1 comment

Comments

@arielmelendez
Copy link

Presently, the constructor for an ArLocal instance takes a dbpath argument that is used in at least 2 ways (but perhaps others as well):

  1. to connect to a sqlite db via connect as currently implemented below:
export const connect = (dbPath: string): Knex => {
  return knex({
    client: 'sqlite3',
    connection: {
      filename: join(dbPath, 'db.sqlite'),
    },
    useNullAsDefault: true,
  });
};

This function, as written, prevents the caller from utilizing the feature of sqlite where passing the filename as :memory: provides you with an in-memory database instance. Perhaps it could be modified to allow that special case.

  1. to provide a path prefix where transaction data can be written (i.e. via the DataDB class).

It would be great to be able to opt into (via constructor arguments, which, by the way, would be better as a single object argument rather than positional arguments) either one or both of those capabilities in an in-memory form via one or more existing or new ArLocal constructor arguments.

Happy to provide more context if necessary. Thanks!

@cedriking
Copy link
Contributor

Thanks @arielmelendez ! added since version 1.1.62.

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

2 participants