{"id":35131353,"url":"https://github.com/oxibase/oxibase","last_synced_at":"2026-05-23T01:05:45.192Z","repository":{"id":329772351,"uuid":"1120127082","full_name":"oxibase/oxibase","owner":"oxibase","description":"Embedding computation within the database management system","archived":false,"fork":false,"pushed_at":"2026-05-13T07:18:15.000Z","size":4493,"stargazers_count":2,"open_issues_count":17,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-13T08:30:51.930Z","etag":null,"topics":["embedded","relational-database","sql"],"latest_commit_sha":null,"homepage":"https://oxibase.xyz","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oxibase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-12-20T14:46:11.000Z","updated_at":"2026-05-13T07:18:21.000Z","dependencies_parsed_at":"2026-02-09T11:13:47.627Z","dependency_job_id":null,"html_url":"https://github.com/oxibase/oxibase","commit_stats":null,"previous_names":["oxibase/oxibase"],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/oxibase/oxibase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxibase%2Foxibase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxibase%2Foxibase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxibase%2Foxibase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxibase%2Foxibase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oxibase","download_url":"https://codeload.github.com/oxibase/oxibase/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxibase%2Foxibase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33015821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded","relational-database","sql"],"created_at":"2025-12-28T05:51:10.623Z","updated_at":"2026-05-23T01:05:45.179Z","avatar_url":"https://github.com/oxibase.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n   \u003cpicture\u003e\n     \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs/assets/img/logo_white.svg\"\u003e\n     \u003cimg src=\"docs/assets/img/logo-alt.svg\" alt=\"Oxibase Logo\" width=\"360\"\u003e\n   \u003c/picture\u003e\n\n   \u003cp\u003eMoving computation to data.\u003c/p\u003e\n\n  \u003cp\u003e\n     \u003ca href=\"https://oxibase.xyz\"\u003eDocs\u003c/a\u003e •\n     \u003ca href=\"https://github.com/oxibase/oxibase/releases\"\u003eReleases\u003c/a\u003e\n  \u003c/p\u003e\n\n  \u003cp\u003e\n     \u003ca href=\"https://github.com/oxibase/oxibase/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/oxibase/oxibase\" alt=\"GitHub release\"\u003e\u003c/a\u003e\n     \u003ca href=\"https://github.com/oxibase/oxibase/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/oxibase/oxibase/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"\u003e\u003c/a\u003e\n     \u003ca href=\"https://crates.io/crates/oxibase\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/oxibase.svg\" alt=\"Crates.io\"\u003e\u003c/a\u003e\n     \u003ca href=\"https://codecov.io/gh/oxibase/oxibase\"\u003e\u003cimg src=\"https://codecov.io/gh/oxibase/oxibase/branch/main/graph/badge.svg\" alt=\"codecov\"\u003e\u003c/a\u003e\n     \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-Apache%202.0-blue.svg\" alt=\"License\"\u003e\u003c/a\u003e\u003cbr\u003e\n     \u003ca href=\"https://app.fossa.com/projects/git%2Bgithub.com%2Foxibase%2Foxibase?ref=badge_shield\u0026issueType=license\" alt=\"FOSSA Status\"\u003e\u003cimg src=\"https://app.fossa.com/api/projects/git%2Bgithub.com%2Foxibase%2Foxibase.svg?type=shield\u0026issueType=license\"/\u003e\u003c/a\u003e\n     \u003ca href=\"https://app.fossa.com/projects/git%2Bgithub.com%2Foxibase%2Foxibase?ref=badge_shield\u0026issueType=security\" alt=\"FOSSA Status\"\u003e\u003cimg src=\"https://app.fossa.com/api/projects/git%2Bgithub.com%2Foxibase%2Foxibase.svg?type=shield\u0026issueType=security\"/\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n## Overview\n\nOxibase is a research project focused on bringing computation as close as\npossible to the data itself, leveraging unikernel technology for\nkernel-integrated performance. Our goal is to investigate how embedding\ncomputation within the database management system, by co-locating logic and\ndata, can eliminate inefficiencies and complexities and enable self-managing\nsystems. We want to provide user-defined functions and libraries to empower\ndevelopers to run business logic directly where the data lives, exploring new\npatterns for local computing and evolving the concept of a 'Modern Mainframe'.\n\n---\n\n\u003e **⚠️ ARCHITECTURAL PIVOT IN PROGRESS**\n\u003e\n\u003e Oxibase is evolving from an embedded SQL library into a distributed Unikernel\n\u003e \"Mainframe\" through iterative research. The documentation below details the\n\u003e **Vision** (our hypotheses) and the **Core Engine** (current implementation).\n\n---\n\n## Vision\n\nIn our ongoing research into distributed systems architecture, we hypothesize\nthat the \"Modern Mainframe\" paradigm represents a fundamental rejection of the\nemergent complexity observed during the microservices epoch. The historical\nbifurcation of \"App Server\" and \"Database Server\" was necessitated by hardware\nconstraints that have since been mitigated through advances in computing\ndensity. By experimentally collapsing this separation, Oxibase positions the\nDBMS not merely as a storage substrate but as the active computational core of\noperations, enabling co-location of logic and data to eliminate observed network\nlatency and serialization inefficiencies in contemporary distributed\narchitectures.\n\nSee [our roadmap](./docs/_docs/roadmap.md) for details.\n\n## Architecture\n\n```\nsrc/\n├── api/        # Public API (Database, Connection, Rows)\n├── core/       # Types (Value, Row, Schema, Error)\n├── parser/     # SQL lexer and parser\n├── planner/    # Query planning\n├── optimizer/  # Cost-based query optimizer\n├── executor/   # Query execution engine\n├── functions/  # 100+ built-in functions\n│   ├── scalar/     # String, math, date, JSON\n│   ├── aggregate/  # COUNT, SUM, AVG, etc.\n│   └── window/     # ROW_NUMBER, RANK, LAG, etc.\n└── storage/    # Storage engine\n    ├── mvcc/       # Multi-version concurrency control\n    └── index/      # B-tree, Hash, Bitmap indexes\n```\n\n## Installation\n\n```bash\n# Add to Cargo.toml\n[dependencies]\noxibase = \"0.3\"\n```\n\nOr build from source:\n\n```bash\ngit clone https://github.com/oxibase/oxibase.git\ncd oxibase\ncargo build --release\n```\n\nOr build from source:\n\n```bash\ngit clone https://github.com/oxibase/oxibase.git\ncd oxibase\ncargo build --release\n```\n\n## Quick Start\n\n### Command Line\n\n```bash\n./oxibase repl                                    # In-memory REPL\n./oxibase repl --db \"file:///path/to/data\"        # Persistent database\n```\n\n\n### As a Library\n\n```rust\nuse oxibase::api::Database;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let db = Database::open_in_memory()?;\n\n    db.execute(\"CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)\", ())?;\n    db.execute(\"INSERT INTO users VALUES (1, 'Alice')\", ())?;\n\n    for row in db.query(\"SELECT * FROM users\", ())? {\n        let row = row?;\n        println!(\"{}: {}\", row.get::\u003ci64\u003e(0)?, row.get::\u003cString\u003e(1)?);\n    }\n\n    Ok(())\n}\n```\n\n## Features\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eMVCC Transactions\u003c/b\u003e\u003c/summary\u003e\n\nFull multi-version concurrency control with two isolation levels:\n\n```sql\n-- Read Committed (default)\nBEGIN;\nUPDATE accounts SET balance = balance - 100 WHERE id = 1;\nUPDATE accounts SET balance = balance + 100 WHERE id = 2;\nCOMMIT;\n\n-- Snapshot Isolation\nBEGIN TRANSACTION ISOLATION LEVEL SNAPSHOT;\nSELECT * FROM accounts;  -- Consistent view throughout transaction\nCOMMIT;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eTime-Travel Queries\u003c/b\u003e\u003c/summary\u003e\n\nQuery historical data at any point in time:\n\n```sql\n-- Query data as it existed at a specific timestamp\nSELECT * FROM orders AS OF TIMESTAMP '2024-01-15 10:30:00';\n\n-- Query data as of a specific transaction\nSELECT * FROM inventory AS OF TRANSACTION 1234;\n\n-- Compare current vs historical data\nSELECT\n    current.price,\n    historical.price AS old_price\nFROM products current\nJOIN products AS OF TIMESTAMP '2024-01-01' historical\n    ON current.id = historical.id\nWHERE current.price != historical.price;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eIndex Types\u003c/b\u003e\u003c/summary\u003e\n\nOxibase automatically selects optimal index types, or you can specify explicitly:\n\n```sql\n-- B-tree: Range queries, sorting, prefix matching\nCREATE INDEX idx_date ON orders(created_at) USING BTREE;\nSELECT * FROM orders WHERE created_at BETWEEN '2024-01-01' AND '2024-12-31';\n\n-- Hash: O(1) equality lookups\nCREATE INDEX idx_email ON users(email) USING HASH;\nSELECT * FROM users WHERE email = 'alice@example.com';\n\n-- Bitmap: Low-cardinality columns, efficient AND/OR\nCREATE INDEX idx_status ON orders(status) USING BITMAP;\nSELECT * FROM orders WHERE status = 'pending' AND priority = 'high';\n\n-- Multi-column composite indexes\nCREATE INDEX idx_lookup ON events(user_id, event_type, created_at);\nSELECT * FROM events WHERE user_id = 100 AND event_type = 'click';\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eWindow Functions\u003c/b\u003e\u003c/summary\u003e\n\nFull support for analytical queries:\n\n```sql\nSELECT\n    employee_name,\n    department,\n    salary,\n    ROW_NUMBER() OVER (PARTITION BY department ORDER BY salary DESC) as rank,\n    salary - LAG(salary) OVER (ORDER BY hire_date) as salary_change,\n    AVG(salary) OVER (PARTITION BY department) as dept_avg,\n    SUM(salary) OVER (ORDER BY hire_date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) as running_total\nFROM employees;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eUser-Defined Functions\u003c/b\u003e\u003c/summary\u003e\n\nOxibase supports user-defined functions (UDFs) via three scripting backends for custom logic in SQL queries:\n\n- **Rhai**: Lightweight, fast scripting language (Rust-based). Ideal for simple calculations and high-performance needs. Always enabled.\n- **Boa (JavaScript)**: Full JavaScript runtime with modern ES features. Best for complex logic, JSON processing, and date manipulation. Enabled with `--features js`.\n- **Python**: Python scripting with access to standard library. Suitable for scientific computing and ML integration. Enabled with `--features python`.\n\nAll backends run in secure sandboxes with no file/network access, limited execution time, and memory isolation. Functions are scalar-only and can return INTEGER, FLOAT, TEXT, BOOLEAN, TIMESTAMP, or JSON types.\n\n```sql\nCREATE FUNCTION calculate_tax(price INTEGER) RETURNS INTEGER\nLANGUAGE RHAI AS 'price * 0.08';\n```\n\nFor detailed documentation, see [User-Defined Functions](docs/_docs/functions/user-defined-functions.md).\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eCommon Table Expressions\u003c/b\u003e\u003c/summary\u003e\n\nIncluding recursive queries:\n\n```sql\n-- Non-recursive CTE\nWITH high_value_orders AS (\n    SELECT * FROM orders WHERE amount \u003e 1000\n)\nSELECT customer_id, COUNT(*) FROM high_value_orders GROUP BY customer_id;\n\n-- Recursive CTE (e.g., organizational hierarchy)\nWITH RECURSIVE org_chart AS (\n    SELECT id, name, manager_id, 1 as level\n    FROM employees WHERE manager_id IS NULL\n\n    UNION ALL\n\n    SELECT e.id, e.name, e.manager_id, oc.level + 1\n    FROM employees e\n    JOIN org_chart oc ON e.manager_id = oc.id\n)\nSELECT * FROM org_chart ORDER BY level, name;\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eAdvanced Aggregations\u003c/b\u003e\u003c/summary\u003e\n\n```sql\n-- ROLLUP: Hierarchical subtotals\nSELECT region, product, SUM(sales)\nFROM sales_data\nGROUP BY ROLLUP(region, product);\n\n-- CUBE: All possible subtotal combinations\nSELECT region, product, SUM(sales)\nFROM sales_data\nGROUP BY CUBE(region, product);\n\n-- GROUPING SETS: Explicit grouping combinations\nSELECT region, product, SUM(sales), GROUPING(region), GROUPING(product)\nFROM sales_data\nGROUP BY GROUPING SETS ((region, product), (region), ());\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eSubqueries\u003c/b\u003e\u003c/summary\u003e\n\nScalar, correlated, EXISTS, and IN subqueries:\n\n```sql\n-- Correlated subquery\nSELECT * FROM employees e\nWHERE salary \u003e (SELECT AVG(salary) FROM employees WHERE department = e.department);\n\n-- EXISTS\nSELECT * FROM customers c\nWHERE EXISTS (SELECT 1 FROM orders o WHERE o.customer_id = c.id AND o.amount \u003e 1000);\n\n-- IN with subquery\nSELECT * FROM products\nWHERE category_id IN (SELECT id FROM categories WHERE active = true);\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eQuery Optimizer\u003c/b\u003e\u003c/summary\u003e\n\nCost-based optimizer with statistics:\n\n```sql\n-- Collect table statistics\nANALYZE orders;\n\n-- View query execution plan\nEXPLAIN SELECT * FROM orders WHERE customer_id = 100;\n\n-- View plan with actual execution statistics\nEXPLAIN ANALYZE SELECT * FROM orders o\nJOIN customers c ON o.customer_id = c.id\nWHERE c.country = 'US';\n```\n\n\u003c/details\u003e\n\n## Data Types\n\n| Type        | Description           | Example                 |\n| ----------- | --------------------- | ----------------------- |\n| `INTEGER`   | 64-bit signed integer | `42`, `-100`            |\n| `FLOAT`     | 64-bit floating point | `3.14`, `-0.001`        |\n| `TEXT`      | UTF-8 string          | `'hello'`, `'日本語'`   |\n| `BOOLEAN`   | true/false            | `TRUE`, `FALSE`         |\n| `TIMESTAMP` | Date and time         | `'2024-01-15 10:30:00'` |\n| `JSON`      | JSON data             | `'{\"key\": \"value\"}'`    |\n\n\n## Persistence\n\nOxibase uses write-ahead logging (WAL) with periodic snapshots:\n\n```bash\n# In-memory (default) - data lost on exit\n./oxibase repl --db \"memory://\"\n\n# File-based - durable storage\n./oxibase repl --db \"file:///var/lib/oxibase/data\"\n```\n\nFeatures:\n\n- **WAL**: All changes logged before applied, survives crashes\n- **Snapshots**: Periodic full database snapshots for faster recovery\n- **Index persistence**: All indexes saved and restored\n\n## Building\n\n```bash\ncargo build              # Debug build\ncargo build --release    # Release build (optimized)\ncargo test               # Run tests\ncargo clippy             # Lint\ncargo doc --open         # Generate documentation\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\nApache License 2.0. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxibase%2Foxibase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foxibase%2Foxibase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxibase%2Foxibase/lists"}