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

updated node example #74

Merged
merged 1 commit into from May 11, 2023
Merged

updated node example #74

merged 1 commit into from May 11, 2023

Conversation

gsilvestrin
Copy link
Contributor

No description provided.

@@ -22,6 +22,7 @@ async function example() {

const tbl = await db.openTable('my_table');
const query = tbl.search([0.1, 0.3]);
query.limit = 20;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this as a chained call so search/limit/execute can a single statement?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are two usability areas to discuss:

  1. should .search also execute by default, and return results?
  2. are we able to chain calls via way of the promises API (in addition to using async/await), i.e:
 const results = await db.openTable('my_table')
        .then(tbl => tbl.search([0.1, 0.3]))
        .then(query => {     
            query.limit = 20;
            return query.execute();
        });

@changhiskhan are you asking about (2)?

I was curious to get folks thoughts on (1) -- should we have search execute the results, and then its one less call to make?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to explore implementing an Options Object for the query params, then we can do the query + exec in one step. @changhiskhan ok with leaving as it is for now?

@jaichopra the async methods we expose support both await and then continuations, up to the user how they want to use it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure we can also collect some user feedback first.

@gsilvestrin gsilvestrin merged commit 202924f into main May 11, 2023
@eddyxu eddyxu deleted the gsilvestrin/limit_example branch June 14, 2023 02:37
raghavdixit99 pushed a commit to raghavdixit99/lancedb that referenced this pull request Apr 5, 2024
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 this pull request may close these issues.

None yet

3 participants