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

Python & JavaScript CLI #1201

Merged
merged 9 commits into from
Dec 2, 2023
Merged

Python & JavaScript CLI #1201

merged 9 commits into from
Dec 2, 2023

Conversation

levkk
Copy link
Contributor

@levkk levkk commented Nov 28, 2023

  1. Add Python CLI.
  2. Add JavaScript CLI in a separate package because npm doesn't allow a package to contain a module and a binary at the same time.
  3. The CLI has just one command: connect, which creates a Postgres FDW connection from a PostgresML db to another PostgreSQL database.
  4. Added PGML_CHECKOUT_TIMEOUT environment variable to control how long we wait for a connection in the SDK pool. Default: 5 seconds. This includes connect timeout for new pools.
  5. cargo fmt.

@montanalow
Copy link
Contributor

Why not Rust? Binary distributable would make life easier.

@levkk
Copy link
Contributor Author

levkk commented Nov 28, 2023

Why not Rust? Binary distributable would make life easier.

Thought about it. The easiest way to distribute a CLI in the Rust world is with cargo install, which requires people to have the Rust toolchain installed. Conversely, if we use our SDK as the distribution vehicle, our CLI is now available to everyone who's using our SDK already in whatever language they choose.

@montanalow
Copy link
Contributor

Right, but we'd have to implement it in each language to accomplish what you're stating with this Python first approach. This method excludes Rust & JS, whereas we could follow the same Rust first method, and get Python/JS distribution for relatively free with the same behavior on all runtimes.

@montanalow
Copy link
Contributor

i.e. all SDKs should have a CLI, and the logic for the CLI should be implemented in the core Rust version.

@levkk
Copy link
Contributor Author

levkk commented Nov 28, 2023

Take a look at the PR, the pieces are all there. The only reason I scoped this to Python is because I know how to make the module callable. In JS, I need to do some research.

@levkk levkk changed the title Python CLI Python & JavaScript CLI Nov 30, 2023
@SilasMarvin SilasMarvin merged commit a7f9a0f into master Dec 2, 2023
1 check passed
@SilasMarvin SilasMarvin deleted the levkk-python-cli branch December 2, 2023 00:48
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