-
Notifications
You must be signed in to change notification settings - Fork 171
Add PostgreSQL Integration Example #129
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
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe PR adds a PostgreSQL integration example: a README with setup and troubleshooting, a Deepnote notebook demonstrating connection, queries, aggregations, inserts/updates and optional cleanup using psycopg2/pandas, and a sample_data.sql that creates an e-commerce schema (4 tables, generated Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer / Notebook
participant Setup as sample_data.sql (DB setup)
participant DB as PostgreSQL (Docker/local)
participant Client as psycopg2 / pandas
rect rgba(200,230,255,0.3)
Note right of Dev: Prepare environment (README + Docker)
Dev->>Setup: Run sample_data.sql (create schema, seed, views, indexes)
Setup->>DB: Execute DDL & DML
DB-->>Setup: Success notices
end
rect rgba(220,255,220,0.3)
Note right of Dev: Notebook runtime cells
Dev->>Client: Open connection (host/port/creds)
Client->>DB: CONNECT
DB-->>Client: Connection OK / version
Dev->>Client: Run queries (SELECT, JOINs, aggregates)
Client->>DB: SQL queries
DB-->>Client: Result sets
Client-->>Dev: DataFrames / prints
Dev->>Client: INSERT / UPDATE (transactional)
Client->>DB: DML + COMMIT
DB-->>Client: Acknowledgement
Dev->>Client: Optional cleanup (DROP statements commented)
end
Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🔇 Additional comments (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
.gitignore(1 hunks)examples/integrations/postgresql/README.md(1 hunks)examples/integrations/postgresql/postgresql-example.deepnote(1 hunks)examples/integrations/postgresql/sample_data.sql(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{md,yml,yaml}
📄 CodeRabbit inference engine (CLAUDE.md)
Use Prettier formatting for Markdown and YAML files
Files:
examples/integrations/postgresql/README.md
🪛 markdownlint-cli2 (0.18.1)
examples/integrations/postgresql/README.md
45-45: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
83-83: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
🔇 Additional comments (1)
.gitignore (1)
12-12: Standard and appropriate addition.
.ipynb_checkpointsis the standard directory created by Jupyter for checkpoint data. This entry correctly excludes it from version control.
|
Hello @NarayanaSabari thank you for the contribution, if you want this to get merged, please sort out the coderabbit review and than we can give you approve. If you are interested in more examples you can do example usage of MongoDB or Clickhouse. |
Signed-off-by: narayanasabari <sabarinarayanakg@proton.me>
|
Hello @Yggdrasill501 , I’ve resolved all the CodeRabbit review comments. ✅ Please let me know if there are any other issues or features you’d like me to focus on besides the examples. Thanks for the guidance! 🙌 |
|
Hi @NarayanaSabari! This is an excellent start 💪 One of the core features of Deepnote is the SQL blocks and the integration system, so it would be great if we could highlight that here. Let's structure the example and README in the following way:
For the Python part, you shouldn't need to install any dependencies, as we ship SQLAlchemy as part of the Deepnote kernel. You can use that together with the integration system to set up a connection: Then you can use it to perform your query: |
Add PostgreSQL Integration Example
Adds a PostgreSQL integration example following the guidance from Discussion #125.
Changes
Adds
examples/integrations/postgresql/with:README.md
postgresql-example.deepnote (24 cells)
sample_data.sql
Testing
Tested locally with:
Checklist
examples/structureThanks for reviewing! I'm excited to contribute to the Deepnote community and happy to make any adjustments based on your feedback. 🚀
cc: @mikayelh
Summary by CodeRabbit
Documentation
New Features
Chores