Skip to content

Commit b2f2cde

Browse files
Merge pull request #174 from Intugle/docs/sqlite-mssql-docs
added sqlite, mysql docs
2 parents 5b37a59 + 05befc5 commit b2f2cde

7 files changed

Lines changed: 176 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Intugle’s GenAI-powered open-source Python library builds a semantic data mode
5353
| Category | Integrations |
5454
| :--- | :--- |
5555
| **Data Warehouses** | Snowflake, Databricks |
56-
| **Databases** | PostgreSQL, SQL Server |
56+
| **Databases** | SQLite, PostgreSQL, SQL Server, MySQL |
5757
| **Local** | Pandas, DuckDB (CSV, Parquet, Excel) |
5858

5959
## Streamlit App

docsite/docs/connectors/implementing-a-connector.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 5
2+
sidebar_position: 7
33
---
44

55
# Implementing a Connector

docsite/docs/connectors/mysql.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
5+
# MySQL
6+
7+
`intugle` integrates with MySQL, allowing you to read data from your tables and views.
8+
9+
## Installation
10+
11+
To use `intugle` with MySQL, you must install the optional dependencies:
12+
13+
```bash
14+
pip install "intugle[mysql]"
15+
```
16+
17+
This installs the `PyMySQL` and `sqlglot` libraries.
18+
19+
## Configuration
20+
21+
To connect to your MySQL database, you must provide connection credentials in a `profiles.yml` file at the root of your project. The adapter looks for a top-level `mysql:` key.
22+
23+
**Example `profiles.yml`:**
24+
25+
```yaml
26+
mysql:
27+
host: <your_mysql_host>
28+
port: 3306 # Default MySQL port
29+
user: <your_username>
30+
password: <your_password>
31+
database: <your_database_name>
32+
```
33+
34+
## Usage
35+
36+
### Reading Data from MySQL
37+
38+
To include a MySQL table or view in your `SemanticModel`, define it in your input dictionary with `type: "mysql"` and use the `identifier` key to specify the object name.
39+
40+
:::caution Important
41+
The dictionary key for your dataset (e.g., `"CUSTOMERS"`) must exactly match the table or view name specified in the `identifier`.
42+
:::
43+
44+
```python
45+
from intugle import SemanticModel
46+
47+
datasets = {
48+
"CUSTOMERS": {
49+
"identifier": "CUSTOMERS", # Must match the key above
50+
"type": "mysql"
51+
},
52+
"ORDERS_VIEW": {
53+
"identifier": "ORDERS_VIEW", # Can be a view
54+
"type": "mysql"
55+
}
56+
}
57+
58+
# Initialize the semantic model
59+
sm = SemanticModel(datasets, domain="E-commerce")
60+
61+
# Build the model as usual
62+
sm.build()
63+
```
64+
65+
### Materializing Data Products
66+
67+
When you use the `DataProduct` class with a MySQL connection, the resulting data product can be materialized as a new **table** or **view** directly within your target database.
68+
69+
```python
70+
from intugle import DataProduct
71+
72+
etl_model = {
73+
"name": "top_customers",
74+
"fields": [
75+
{"id": "CUSTOMERS.customer_id", "name": "customer_id"},
76+
{"id": "CUSTOMERS.name", "name": "customer_name"},
77+
]
78+
}
79+
80+
dp = DataProduct()
81+
82+
# Materialize as a view (default)
83+
dp.build(etl_model, materialize="view")
84+
85+
# Materialize as a table
86+
dp.build(etl_model, materialize="table")
87+
```

docsite/docs/connectors/sqlite.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
5+
# SQLite
6+
7+
`intugle` integrates with SQLite, allowing you to read data from your local database files.
8+
9+
## Installation
10+
11+
To use `intugle` with SQLite, you generally only need the base package as `sqlite3` is included in Python. However, for SQL generation features, `sqlglot` is required.
12+
13+
```bash
14+
pip install intugle sqlglot
15+
```
16+
17+
## Configuration
18+
19+
To connect to your SQLite database, you must provide the path to your database file in a `profiles.yml` file at the root of your project. The adapter looks for a top-level `sqlite:` key.
20+
21+
**Example `profiles.yml`:**
22+
23+
```yaml
24+
sqlite:
25+
path: /absolute/path/to/your/database.db
26+
```
27+
28+
## Usage
29+
30+
### Reading Data from SQLite
31+
32+
To include a SQLite table or view in your `SemanticModel`, define it in your input dictionary with `type: "sqlite"` and use the `identifier` key to specify the object name.
33+
34+
```python
35+
from intugle import SemanticModel
36+
37+
datasets = {
38+
"CUSTOMERS": {
39+
"identifier": "CUSTOMERS",
40+
"type": "sqlite"
41+
},
42+
"ORDERS": {
43+
"identifier": "ORDERS",
44+
"type": "sqlite"
45+
}
46+
}
47+
48+
# Initialize the semantic model
49+
sm = SemanticModel(datasets, domain="E-commerce")
50+
51+
# Build the model as usual
52+
sm.build()
53+
```
54+
55+
### Materializing Data Products
56+
57+
When you use the `DataProduct` class with a SQLite connection, the resulting data product can be materialized as a new **table** or **view** directly within your database.
58+
59+
```python
60+
from intugle import DataProduct
61+
62+
etl_model = {
63+
"name": "top_customers",
64+
"fields": [
65+
{"id": "CUSTOMERS.customer_id", "name": "customer_id"},
66+
{"id": "CUSTOMERS.name", "name": "customer_name"},
67+
]
68+
}
69+
70+
dp = DataProduct()
71+
72+
# Materialize as a view (default)
73+
dp.build(etl_model, materialize="view")
74+
75+
# Materialize as a table
76+
dp.build(etl_model, materialize="table")
77+
```

docsite/docs/intro.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,11 @@ Intugle’s GenAI-powered open-source Python library builds an intelligent seman
2525
* **Semantic Data Model:** Transform raw, fragmented datasets into an intelligent semantic graph that captures entities, relationships, and context — the foundation for connected intelligence.
2626
* **Business Glossary & Semantic Search:** Auto-generate a business glossary and enable search that understands meaning, not just keywords — making data more accessible across technical and business users.
2727
* **Data Products:** Instantly generate SQL and reusable data products enriched with context, eliminating manual pipelines and accelerating data-to-insight.
28+
29+
## Supported Integrations
30+
31+
| Category | Integrations |
32+
| :--- | :--- |
33+
| **Data Warehouses** | Snowflake, Databricks |
34+
| **Databases** | SQLite, PostgreSQL, SQL Server, MySQL |
35+
| **Local** | Pandas, DuckDB (CSV, Parquet, Excel) |

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "intugle"
7-
version = "1.2.0"
7+
version = "1.2.1"
88
authors = [
99
{ name="Intugle", email="hello@intugle.ai" },
1010
]

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)