This repository provides a collection of Metabase questions defined through .sql scripts.
These SQL files can be imported or executed directly within Metabase to create reusable queries and dashboards for data analysis.
The goal of this repository is to help teams quickly deploy and maintain consistent Metabase analytics across environments.
Lokavaluto's purpose is to pool human and financial resources around the IT issues faced by local currencies. The association relieves local currencies of the need for technical expertise, operational maintenance, technology watch and software development, enabling them to concentrate on their core activity: running and developing local currencies!
This work has been sponsorised by NGI Local for Local european program 
Before starting, make sure you have the following installed and configured:
- Metabase (v0.50 or higher)
- Docker (recommended)
- Access to your target databases (e.g., PostgreSQL, MySQL, etc.)
- Proper credentials for connecting Metabase to your data sources
If you want to run Metabase locally using Docker:
docker run -d -p 3000:3000 --name metabase metabase/metabaseOnce the container is running, open http://localhost:3000 and complete the initial setup.
From the Metabase Admin panel:
- Go to Admin Settings → Databases → Add database
- Fill in your database credentials (host, port, user, password, etc.)
- Save and test the connection
Make sure the schema you want to query is accessible by the configured user.
WARNING: the SQL script shared here are working ONLY with Metabase connected to :
- an Odoo v16 Postgress database with Lokavaluto's addons
- Comchain or Cyclos transactions backends databases
The file model_transactions_data.sql allows the build of a Metabase model with all the calculated data needed to run queries and display dashboards.
You can add them to Metabase manually:
- Open the SQL file you want to import
- Copy its content
- In Metabase, go to “Models”, click on the top left "+"
- Select "Native querry"
- Paste the SQL query and save it with a descriptive name
Each .sql file in the /queries directory represents a Metabase question.
You can add them to Metabase manually:
- Open the SQL file you want to import
- Copy its content
- In Metabase, go to “Ask a Question → Native Query”
- Select the correct database connection
- Paste the SQL query and save it with a descriptive name
You can easily adapt the provided SQL scripts to your data model or visualization needs.
- Change schema or table names to match your local configuration.
- Add parameters using Metabase’s variable syntax
- Modify visualization settings (chart type, colors, filters) directly in the Metabase UI.
- Organize questions into collections to group dashboards by theme (e.g., "Transactions", "User Activity", "KYC Data").
If your environment uses multiple data sources (for example Odoo, Cyclos, and Comchain), make sure to adjust the connection ID in your API payloads or within Metabase.
Contributions are welcome! If you’d like to propose new queries, improve existing ones, or fix issues:
- Fork the repository
- Create a new branch for your feature or fix
git checkout -b feature/new-query
- Add or modify your
.sqlscripts in the/queriesdirectory - Submit a Pull Request with a clear explanation of your contribution
- Use clear, descriptive filenames (e.g.,
user_growth_last_30_days.sql) - Keep queries readable and commented
- Test your queries in Metabase before committing
- Follow the existing project structure and naming conventions
Maintainer:
Lokavaluto - lokavaluto.fr
For any questions or support, please open an issue on GitHub.
