Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

MuMi SQL

Lightweight embedded SQL engine in Pascal.

License: MIT


🌟 Features

  • Pure Pascal – Written in Object Pascal, compiles with Free Pascal.
  • Zero Historical Baggage – Clean design, no legacy compatibility hacks.
  • Embedded by Design – Minimal memory footprint, ideal for resource-constrained devices.
  • Modular Architecture – Core + Plus structure, pluggable components.
  • Cross-Platform – Supports Windows, Linux, macOS, DOS (and more).
  • Interactive REPL – Centered input line, colorful syntax hinting, built-in editor.
  • MIT Licensed – Use it anywhere, freely.

🚀 Quick Start

Prerequisites

Build

# Using Lazarus
open MuMiSQL.lpi and press F9

# Using command line (Windows)
ppc386 MuMiSQL.lpr

# Using command line (Linux/macOS)
fpc MuMiSQL.lpr

Run

./MuMiSQL

Then type SQL commands in the REPL:

SELECT * FROM users WHERE age > 18;

🧩 Project Structure

MuMiSQL/
├── Core/          # Core engine (must keep)
│   ├── Types      # Type definitions
│   ├── Lexer      # SQL tokenizer
│   ├── Parser     # SQL parser & AST builder
│   ├── Executor   # Query executor
│   ├── Storage    # B-Tree / Page storage
│   └── ...
├── Plus/          # Optional extensions (can be removed)
│   ├── TUI        # Text user interface
│   ├── Shell      # Shell command integration
│   ├── Unicode    # Unicode utilities
│   └── ...
├── repl.pas       # Interactive REPL
├── commands*.pas  # Built-in commands
└── MuMiSQL.lpr    # Main entry point

🛠️ Built-in Commands

Command 描述
:help Show available commands
:exit Exit REPL
:listen <ip> <port> Start TCP server
:connect <db> Open another database file
! <cmd> Execute system shell command

📦 Supported SQL (Initial)

  • SELECT ... FROM ... WHERE ...
  • INSERT INTO ... VALUES ...
  • UPDATE ... SET ... WHERE ...
  • DELETE FROM ... WHERE ...
  • CREATE TABLE ...
  • DROP TABLE ...

More features (JOIN, subqueries, indexes) will come as optional Plus extensions.


🤝 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

  • Fork the repo
  • Create your feature branch (git checkout -b feature/amazing)
  • Commit your changes (git commit -m 'Add something')
  • Push to the branch (git push origin feature/amazing)
  • Open a Pull Request

📜 License

Distributed under the MIT License. See LICENSE file for more information.


About

A lightweight SQL database engine for embedded systems, written in Pascal.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages