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

COMPETES import scripts #30

Open
2 of 3 tasks
Tracked by #12
clizbe opened this issue May 6, 2024 · 0 comments
Open
2 of 3 tasks
Tracked by #12

COMPETES import scripts #30

clizbe opened this issue May 6, 2024 · 0 comments
Labels
Type: addition Add something that doesn't exist Zone: interop Interop between Julia & DuckDB

Comments

@clizbe
Copy link
Member

clizbe commented May 6, 2024

Tasks

  • Imported to SQLite
  • Recipe to attach SQLite db to DuckDB
    • Optionally, if necessary, may convert to native DuckDB
  • Scripts to convert tables to what Tulipa expects

Export MS Access db to SQlite

This works on Linux (so also works on Windows WSL):

  1. Install mdbtools & sqlite-tools (optional)
  2. Then in the shell (bash)
    mdb-schema /path/to/ms-access.mdb > schema.sql
    sqlite3 /path/to/sqlite-copy.db < schema.sql
    for tbl in $(IFS=$'\n' mdb-tables -1 /path/to/ms-access.mdb); do
      {
          mdb-export /path/to/ms-access.mdb "$tbl" | \
            sqlite-utils insert -c /path/to/sqlite-copy.db "$tbl" - ;
      } && echo "'$tbl' exported";
    done

Reading from DuckDB

See SQLite import

INSTALL sqlite;
ATTACH 'sqlite-copy.db' AS competes (TYPE sqlite);
USE competes;
SHOW TABLES;
@clizbe clizbe changed the title COMPETES COMPETES import scripts May 6, 2024
@suvayu suvayu added Type: addition Add something that doesn't exist Zone: interop Interop between Julia & DuckDB labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: addition Add something that doesn't exist Zone: interop Interop between Julia & DuckDB
Projects
None yet
Development

No branches or pull requests

2 participants