An Elixir/Phoenix OData v4 server that provides Excel connectivity to DuckDB data sources. Modeta enables users to query data from Excel using pivot tables without impacting database performance through intelligent caching.
- OData v4 Compliance: Full compatibility with Excel/Power Query
- DuckDB Integration: Direct connection to DuckDB with ADBC
- Dynamic Schema: Automatic schema introspection and OData metadata generation
- Excel Compatible: Tested and working with Microsoft Excel
- High Performance: READ_ONLY connections for maximum concurrency
- BigQuery Ready: Architecture supports future BigQuery integration
- Elixir 1.17+
- DuckDB
- ADBC drivers
- Clone the repository and install dependencies:
mix setup
- Configure your collections in
config/collections.yml
:
collections:
- name: customers
query: "SELECT * FROM customers"
- Load sample data (optional):
mix run -e "Modeta.DataLoader.load_customers_csv()"
- Start the server:
mix phx.server
The OData service will be available at http://localhost:4000/modeta/
- Open Excel
- Go to Data > Get Data > From Other Sources > From OData Feed
- Enter the URL:
http://localhost:4000/modeta/
- Select your authentication method (Anonymous for local development)
- Choose the tables/collections you want to import
- Load the data into Excel
- Service Document:
GET /modeta/
- Lists available collections - Metadata:
GET /modeta/$metadata
- OData schema definition (XML) - Collections:
GET /modeta/{collection}
- Entity data with OData context
# Service document
curl http://localhost:4000/modeta/
# Metadata
curl http://localhost:4000/modeta/\$metadata
# Customer data
curl http://localhost:4000/modeta/customers
Define your data collections in config/collections.yml
:
collections:
- name: products
query: "SELECT id, name, price, category FROM products"
- name: orders
query: "SELECT * FROM orders WHERE created_at > '2023-01-01'"
Excel → OData v4 Server (Elixir) → DuckDB → [Future: BigQuery]
- Phoenix Router: OData endpoint routing (
/modeta/*
) - OData Controller: Service document, metadata, and collection handlers
- Cache Module: DuckDB query execution with ADBC
- Collections Module: Configuration and query management
- Schema Introspection: Dynamic DuckDB table schema detection
Modeta implements OData v4 specification features required for Excel compatibility:
- Service Document: JSON format with EntitySet listings
- Metadata Document: XML CSDL with dynamic schema
- Generic Entity Types:
OpenType="true"
for flexible schemas - Content Negotiation: Supports
odata.metadata=minimal|full|none
- Proper Headers:
OData-Version: 4.0
with enhanced content-types
mix test
- Add configuration to
config/collections.yml
- Ensure the underlying data/tables exist in DuckDB
- Restart the server
- The collection will be automatically available via OData
- BigQuery integration (Phase 2)
- Intelligent caching with TTL (Phase 3)
- OData query options (
$filter
,$orderby
,$top
,$skip
) - Authentication and authorization
- Monitoring and metrics dashboard