You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
0.2.4 - Fixed several bugs and add alias support (#6)
* Update connection string pattern
* Fixed pagination bug
* Fixed the type_code issue in desc
* Reformat code
* Unify the format of code
* Support alias in SQL query
* Update README to reflect the new changes
* Fix test case issue
---------
Co-authored-by: Peng Ren <ia250@cummins.com>
Copy file name to clipboardExpand all lines: README.md
+28-4Lines changed: 28 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,16 +14,18 @@ PyMongoSQL is a Python [DB API 2.0 (PEP 249)](https://www.python.org/dev/peps/pe
14
14
15
15
## Objectives
16
16
17
-
PyMongoSQL implements the DB API 2.0 interfaces to provide SQL-like access to MongoDB. The project aims to:
17
+
PyMongoSQL implements the DB API 2.0 interfaces to provide SQL-like access to MongoDB, built on PartiQL syntax for querying semi-structured data. The project aims to:
18
18
19
-
- Bridge the gap between SQL and NoSQL by providing SQL capabilities for MongoDB
20
-
- Support standard SQL DQL (Data Query Language) operations including SELECT statements with WHERE, ORDER BY, and LIMIT clauses
19
+
- Bridge the gap between SQL and NoSQL by providing SQL capabilities for MongoDB's nested document structures
20
+
- Support standard SQL DQL (Data Query Language) operations including SELECT statements with WHERE, ORDER BY, and LIMIT clauses on nested and hierarchical data
21
21
- Provide seamless integration with existing Python applications that expect DB API 2.0 compliance
22
-
- Enable easy migration from traditional SQL databases to MongoDB
22
+
- Enable easy migration from traditional SQL databases to MongoDB without rewriting queries for document traversal
23
23
24
24
## Features
25
25
26
26
-**DB API 2.0 Compliant**: Full compatibility with Python Database API 2.0 specification
27
+
-**PartiQL-based SQL Syntax**: Built on [PartiQL](https://partiql.org/tutorial.html) (SQL for semi-structured data), enabling seamless SQL querying of nested and hierarchical MongoDB documents
28
+
-**Nested Structure Support**: Query and filter deeply nested fields and arrays within MongoDB documents using standard SQL syntax
27
29
-**SQLAlchemy Integration**: Complete ORM and Core support with dedicated MongoDB dialect
28
30
-**SQL Query Support**: SELECT statements with WHERE conditions, field selection, and aliases
29
31
-**Connection String Support**: MongoDB URI format for easy configuration
@@ -140,6 +142,7 @@ while users:
140
142
### SELECT Statements
141
143
- Field selection: `SELECT name, age FROM users`
142
144
- Wildcards: `SELECT * FROM products`
145
+
-**Field aliases**: `SELECT name as user_name, age as user_age FROM users`
143
146
-**Nested fields**: `SELECT profile.name, profile.age FROM users`
144
147
-**Array access**: `SELECT items[0], items[1].name FROM orders`
145
148
@@ -176,6 +179,27 @@ while users:
176
179
177
180
These features are on our development roadmap and contributions are welcome!
178
181
182
+
## Apache Superset Integration
183
+
184
+
PyMongoSQL can be used as a database driver in Apache Superset for querying and visualizing MongoDB data:
185
+
186
+
1.**Install PyMongoSQL**: Install PyMongoSQL on the Superset app server:
187
+
```bash
188
+
pip install pymongosql
189
+
```
190
+
2.**Create Connection**: Connect to your MongoDB instance using the connection URI with superset mode:
3.**Use SQL Lab**: Write and execute SQL queries against MongoDB collections directly in Superset's SQL Lab
199
+
4.**Create Visualizations**: Build charts and dashboards from your MongoDB queries using Superset's visualization tools
200
+
201
+
This allows seamless integration between MongoDB data and Superset's BI capabilities without requiring data migration to traditional SQL databases.
202
+
179
203
## Contributing
180
204
181
205
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
0 commit comments