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

feat: postgres integration - create database #932

Merged
merged 8 commits into from
Aug 16, 2023
Merged

feat: postgres integration - create database #932

merged 8 commits into from
Aug 16, 2023

Conversation

gaurav274
Copy link
Member

@gaurav274 gaurav274 commented Aug 15, 2023

  1. Add support for creating database
CREATE DATABASE db
WITH ENGINE = "postgres",
PARAMETERS = {
    "user": "user",
    "password": "password",
    "host": "127.0.0.1",
    "port": "5432",
    "database": "demo"
};
  1. Persist the info in the catalog
  2. Todo: Verify if the provided info is valid - next PR

# For certain statements, we plan to omit binder and optimizer to keep the code
# clean. So, we handle such cases here and pass the statement directly to the
# executor.
if stmt not in SKIP_BINDER_AND_OPTIMIZER_STATEMENTS:
Copy link
Member Author

Choose a reason for hiding this comment

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

@xzdandy @jiashenC Added a skipping behavior in the system to avoid having to write boilerplate code for binder, optimizer.

@gaurav274 gaurav274 requested review from jiashenC and xzdandy and removed request for jiashenC August 16, 2023 03:08
@xzdandy
Copy link
Collaborator

xzdandy commented Aug 16, 2023

Looks good to me. To make it clear, the default engine (for now, sqlite3) in evadb/catalog/sql_config.py will not have an entry in DatabaseCatalog (otherwise, we have a loop. Maybe we can actually, so it is not treated differently with any other databases created later by the user).
Some decisions we need to think are

  • Is the default engine only storing EvaDB's metadata or it can also store user's data? In other words, can user use the EvaDB without connecting to any other structure databases?
  • Is the default engine always local or it can also connect to a remote database? Sharing model and external database connection with other users.

@xzdandy
Copy link
Collaborator

xzdandy commented Aug 16, 2023

The Test | v3.10 | Linux | Postgres test actually failed. Need to take a look.

@gaurav274
Copy link
Member Author

Looks good to me. To make it clear, the default engine (for now, sqlite3) in evadb/catalog/sql_config.py will not have an entry in DatabaseCatalog (otherwise, we have a loop. Maybe we can actually, so it is not treated differently with any other databases created later by the user). Some decisions we need to think are

  • Is the default engine only storing EvaDB's metadata or it can also store user's data? In other words, can user use the EvaDB without connecting to any other structure databases?
  • Is the default engine always local or it can also connect to a remote database? Sharing model and external database connection with other users.

Will document it in our design docs

@gaurav274 gaurav274 merged commit 0f1bcf6 into master Aug 16, 2023
@gaurav274 gaurav274 deleted the psql branch August 16, 2023 23:25
@gaurav274 gaurav274 self-assigned this Aug 25, 2023
@gaurav274 gaurav274 added the Integrations 🧩 Pull requests that update an integration label Aug 25, 2023
@gaurav274 gaurav274 added this to the v0.3.2 milestone Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Integrations 🧩 Pull requests that update an integration
Projects
Development

Successfully merging this pull request may close these issues.

2 participants