Skip to content

Automation to export the latest release of the ACE data as SQLite databases served via Datasette

License

Notifications You must be signed in to change notification settings

amoeba/ace-to-sqlite

Repository files navigation

ace-to-sqlite

Automation to export the latest releases of ACEmulator data as SQLite databases served via Datasette.

See it live at https://acedb.treestats.net.

Databases

The following data sources are included:

Rationale

People sometimes want to know if certain items are in the game or build things on top of ACE data. The best way to do this is to query the ACE database. This makes that (and more) easier.

Methodology

I didn't find a good tool that can directly convert MySQL DDL (What ACE stores its data as) to SQLite DDL (what we need for loading into Datasette). After trying to some things, I settled on the following set of steps:

  • Spin up a MySQL instance
  • Load MySQL DDL files in
  • Run a custom version of db-to-sqlite
  • Publish to Fly.io with Datasette.

Running This Yourself

This automation is a GitHub Action so please look at https://github.com/amoeba/ace-to-sqlite/blob/main/.github/workflows/export.yml for the steps.

If you're interested in running the automation yourself and in another environment, look at https://github.com/amoeba/ace-to-sqlite/blob/main/scripts/generate_world_database.sh which will download and convert the latest ACE World release to SQLite. Its requirements are:

  • A local MySQL server instance with the root password off
  • bash
  • curl
  • jq
  • unzip
  • Python
  • db-to-sqlite (Installed from my fork)

How this GitHub Repository Works

This repo can automatically pull in a specific ACE database release using GitHub Actions. To pull a new release and re-publish the database, run:

export ACE_TAG="changeme"
git tag -a $ACE_TAG -m "$ACE_TAG"
git push --follow-tags

Deployment

https://acedb.treestats.net/ is deployed on a private VPS running Dokku so only I can perform a deployment. Here are my steps:

  • Publish a new "latest" release by re-tagging "latest" and pushing to the repo

    git tag -d latest
    git tag -a latest -m latest
    git push --force --tags
  • Wait for the Action to finish

  • Push to dokku VPS

Contributing

Please file an Issue if you have any questions or commands. An example of a good type of issue to file would be if you want a datasource included here that isn't or if you find either a data or documentation issue.