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

API refactoring: move the query() function #92

Closed
szkiba opened this issue Oct 21, 2024 · 0 comments · Fixed by #93
Closed

API refactoring: move the query() function #92

szkiba opened this issue Oct 21, 2024 · 0 comments · Fixed by #93
Assignees

Comments

@szkiba
Copy link
Contributor

szkiba commented Oct 21, 2024

Currently, the query() function is at the module level and expects the database handle as the first parameter.

function query(db Database, query: string, ...args: any[]): Row[];

interface Database {
  exec(query: string, ...args: any[]): Result;
  close(): void;
}

The query() function should be a member function of the database handle object, similarly to the exec() function.

interface Database {
  exec(query: string, ...args: any[]): Result;
  query(query: string, ...args: any[]): Row[];
  close(): void;
}
@szkiba szkiba self-assigned this Oct 21, 2024
@szkiba szkiba linked a pull request Oct 21, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant