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

[JSTC-17] Support smart SQL batching and import from SQL files #88

Closed
carsonfarmer opened this issue Sep 16, 2022 · 4 comments
Closed
Assignees
Labels
linear Sync issue with linear

Comments

@carsonfarmer
Copy link
Member

carsonfarmer commented Sep 16, 2022

Is your feature request related to a problem? Please describe.

  • Writing many SQL statements from the command line right now is cumbersome, it would be great if we had a flag or other way to simply ingest SQL statements and push these to tableland
  • Once we do support multiple statements at once, we'll need to have a nice way to batch and break these statements up into the right size for sending to the smart contract.
  • Additionally, we should normalize the input statements so that they are more likely to succeed, using our custom parser

Describe the solution you'd like

Something like a --sql flag to would take a local SQL file, and normalize the statements, put them into appropriate sized batches, and then wait for confirmation to send.

Describe alternatives you've considered

Not waiting for confirmation would be ok too, but this feels safer for users. Ideally, you could actually use local files, or remote files, and the cli would just do the right thing.

JSTC-17

@carsonfarmer carsonfarmer added docs Improvements or additions to documentation feat New feature or request labels Sep 16, 2022
@carsonfarmer carsonfarmer self-assigned this Sep 16, 2022
@carsonfarmer
Copy link
Member Author

Building this out a bit further, we should provide a --file / -f option for anything that takes an input. So read, write, create, etc. Additionally, if a file parameter is given as a hyphen (e.g., -f -), it means grab the data from stdin. This is a common command-line convention which we should adopt.

This would allow things like:

echo "select * from some_table_5_99" | tableland query --file - | jq

Which is useful for piping and chaining tableland commands.

@sanderpick
Copy link
Member

i know i'm late the party here, but this sounds great. there's some overlap with convos we'll have next week, but i think whatever we do around supporting sql files directly, we'll always need batching

@carsonfarmer
Copy link
Member Author

Yeh nice, thanks for weighing in here. So there is a PR in flight that adds this basic --file (and stdin input, without the need to specify --file -, but doesn't do the batching yet. I'm actually going to put the rest of the current local first CLI project on hold until we get some more clarity and finalized plans over the next two weeks. In the mean time, the above exact API flow will already be possible via tablelandnetwork/js-tableland-cli#110.

@awmuncy awmuncy added the linear Sync issue with linear label Mar 24, 2023
@sanderpick sanderpick changed the title Feature: Support smart SQL batching and import from SQL files Support smart SQL batching and import from SQL files Mar 24, 2023
@sanderpick sanderpick added linear Sync issue with linear and removed linear Sync issue with linear docs Improvements or additions to documentation feat New feature or request labels Mar 24, 2023
@sanderpick sanderpick changed the title Support smart SQL batching and import from SQL files [JSTC-17] Support smart SQL batching and import from SQL files Mar 24, 2023
@dtbuchholz dtbuchholz transferred this issue from tablelandnetwork/js-tableland-cli Nov 21, 2023
@dtbuchholz dtbuchholz added linear Sync issue with linear and removed linear Sync issue with linear labels Nov 21, 2023
@dtbuchholz
Copy link
Contributor

dtbuchholz commented Nov 21, 2023

(test comment from GH to see if things sync to linear for a transferred issue)

note: it didn't work. recreated at #89

@dtbuchholz dtbuchholz closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear Sync issue with linear
Projects
No open projects
Status: 🟣 Blocked
Development

No branches or pull requests

4 participants