Skip to content

Commit d62db21

Browse files
committed
feat: Replace duckdb automated export with manual export instructions
1 parent 58db401 commit d62db21

File tree

9 files changed

+48
-33
lines changed

9 files changed

+48
-33
lines changed

.github/workflows/export.yml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Export JSON/XML/YAML/CSV/MYSQL/PSQL/SQLITE/DUCKDB/SQLSERVER/MONGODB
1+
name: Export JSON/XML/YAML/CSV/MYSQL/PSQL/SQLITE/SQLSERVER/MONGODB
22

33
on:
44
push:
@@ -15,7 +15,7 @@ on:
1515

1616
jobs:
1717
export:
18-
name: JSON/XML/YAML/CSV/MYSQL/PSQL/SQLITE/DUCKDB/SQLSERVER/MONGODB
18+
name: JSON/XML/YAML/CSV/MYSQL/PSQL/SQLITE/SQLSERVER/MONGODB
1919
runs-on: ubuntu-24.04
2020

2121
strategy:
@@ -183,24 +183,7 @@ jobs:
183183
mysql2sqlite -d world -t cities --mysql-password root -u root -f sqlite/cities.sqlite3
184184
mysql2sqlite -d world --mysql-password root -u root -f sqlite/world.sqlite3
185185
186-
- name: Setup DuckDB
187-
run: |
188-
pip install duckdb
189186
190-
- name: Export DuckDB
191-
run: |
192-
# Clean up any existing DuckDB files first
193-
rm -rf duckdb/*.db
194-
195-
# Convert SQLite to DuckDB format
196-
python3 bin/import_duckdb.py --input sqlite/world.sqlite3 --output duckdb/world.db
197-
198-
# Create individual table databases for consistency with other formats
199-
python3 bin/import_duckdb.py --input sqlite/regions.sqlite3 --output duckdb/regions.db
200-
python3 bin/import_duckdb.py --input sqlite/subregions.sqlite3 --output duckdb/subregions.db
201-
python3 bin/import_duckdb.py --input sqlite/countries.sqlite3 --output duckdb/countries.db
202-
python3 bin/import_duckdb.py --input sqlite/states.sqlite3 --output duckdb/states.db
203-
python3 bin/import_duckdb.py --input sqlite/cities.sqlite3 --output duckdb/cities.db
204187
205188
- name: Export SQL Server
206189
working-directory: ./bin
@@ -253,7 +236,7 @@ jobs:
253236
✅ All export formats completed successfully:
254237
- JSON/XML/YAML/CSV: Structured data exports
255238
- MySQL/PostgreSQL: SQL dump exports
256-
- SQLite/DuckDB: Database file exports
239+
- SQLite: Database file exports
257240
- SQL Server/MongoDB: Alternative format exports
258241
259242
📊 Total records: ${{ env.country_count }} countries, ${{ env.state_count }} states, ${{ env.city_count }} cities
@@ -275,14 +258,13 @@ jobs:
275258
- **Cities**: ${{ env.city_count }}
276259
277260
### ✅ Generated Formats
278-
- **JSON** - Structured data format
261+
- **JSON** - Structured data format
279262
- **XML** - Markup language format
280263
- **YAML** - Human-readable format
281264
- **CSV** - Spreadsheet format
282265
- **MySQL** - Database dumps
283266
- **PostgreSQL** - Database dumps
284267
- **SQLite** - Portable databases
285-
- **DuckDB** - Analytical databases
286268
- **SQL Server** - T-SQL scripts
287269
- **MongoDB** - Collections + dump
288270

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ scripts/vendor/data/*
1111
scripts/vendor/vendor
1212
__pycache__/
1313
*.pyc
14+
dev/
1415

1516
# Generated export files (build artifacts)
1617
# These are automatically generated by export commands

README.md

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ All Countries, States & Cities are Covered & Populated with Different Combinatio
2222
- [Insights](#insights)
2323
- [Next API Database Update](#next-api-database-update)
2424
- [Import MongoDB](#import-mongodb)
25+
- [Export to DuckDB](#export-to-duckdb)
2526
- [License](#license)
2627
- [Contributing](#contributing)
2728
- [Repo Activity](#repo-activity)
@@ -76,25 +77,27 @@ Perfect for developers, researchers, and businesses who need clean, structured g
7677
- MYSQL
7778
- PSQL
7879
- SQLITE
79-
- DUCKDB
8080
- SQLSERVER
8181
- MONGODB
8282
- XML
8383
- YAML
8484
- CSV
8585

86+
**Note:** DuckDB format is available via manual conversion from SQLite files. See the [Export to DuckDB](#export-to-duckdb) section for instructions.
87+
8688
## Distribution Files Info
8789

88-
| File | JSON | MYSQL | PSQL | SQLITE | DUCKDB | SQLSERVER | MONGODB | XML | YAML | CSV |
89-
| :------------------------- | :--- | :---- | :--- | :----- | :----- | :-------- | :------ | :-- | :--- | :-- |
90-
| Regions |||||||||||
91-
| Subregions |||||||||||
92-
| Countries |||||||||||
93-
| States |||||||||||
94-
| Cities |||||||||||
95-
| Country+States || NA | NA | NA | NA | NA | NA | NA | NA | NA |
96-
| Country+Cities || NA | NA | NA | NA | NA | NA | NA | NA | NA |
97-
| Country+State+Cities/World |||||||| NA | NA | NA |
90+
| File | JSON | MYSQL | PSQL | SQLITE | SQLSERVER | MONGODB | XML | YAML | CSV |
91+
| :------------------------- | :--- | :---- | :--- | :----- | :-------- | :------ | :-- | :--- | :-- |
92+
| Regions ||||||||||
93+
| Subregions ||||||||||
94+
| Countries ||||||||||
95+
| States ||||||||||
96+
| Cities ||||||||||
97+
| Country+States || NA | NA | NA | NA | NA | NA | NA | NA |
98+
| Country+Cities || NA | NA | NA | NA | NA | NA | NA | NA |
99+
| Country+State+Cities/World ||||||| NA | NA | NA |
100+
98101

99102
## Demo
100103

@@ -132,6 +135,35 @@ tar -xzvf world-mongodb-dump.tar.gz
132135
mongorestore --host localhost:27017 --db world mongodb-dump/world
133136
```
134137

138+
## Export to DuckDB
139+
140+
Want to export the database to DuckDB format? You can easily convert the existing SQLite files to DuckDB format using our conversion script.
141+
142+
### Prerequisites
143+
144+
First, install DuckDB Python package:
145+
146+
```bash
147+
pip install duckdb
148+
```
149+
150+
### Convert SQLite to DuckDB
151+
152+
Use the provided conversion script to convert SQLite files to DuckDB format:
153+
154+
```bash
155+
# Convert the complete world database
156+
python3 bin/import_duckdb.py --input sqlite/world.sqlite3 --output duckdb/world.db
157+
158+
# Convert individual table databases
159+
python3 bin/import_duckdb.py --input sqlite/regions.sqlite3 --output duckdb/regions.db
160+
python3 bin/import_duckdb.py --input sqlite/subregions.sqlite3 --output duckdb/subregions.db
161+
python3 bin/import_duckdb.py --input sqlite/countries.sqlite3 --output duckdb/countries.db
162+
python3 bin/import_duckdb.py --input sqlite/states.sqlite3 --output duckdb/states.db
163+
python3 bin/import_duckdb.py --input sqlite/cities.sqlite3 --output duckdb/cities.db
164+
```
165+
166+
The conversion script will create DuckDB database files that maintain the same structure and data as the original SQLite files, optimized for analytical workloads.
135167

136168
## License
137169

duckdb/cities.db

-8.01 MB
Binary file not shown.

duckdb/countries.db

-780 KB
Binary file not shown.

duckdb/regions.db

-524 KB
Binary file not shown.

duckdb/states.db

-524 KB
Binary file not shown.

duckdb/subregions.db

-524 KB
Binary file not shown.

duckdb/world.db

-13.3 MB
Binary file not shown.

0 commit comments

Comments
 (0)