UltraSQL is a minimalist database system built in Go, designed to be lightweight, fast, and easy to use. It provides file-based storage, a custom query engine, and extendable indexing, making it ideal for learners and small-scale applications.
- File-based Storage: Minimalistic, efficient file handling for data persistence.
- Custom Query Engine: Support for basic SQL-like queries.
- Extendable Indexing: Flexible indexing mechanisms for optimizing queries.
- Transaction Management: Ensures data consistency with ACID properties.
- Built-in Logging: Debugging and performance tracking tools.
- Lightweight and ideal for embedded use cases.
- Perfect for learning database internals.
- Built in Go for simplicity, extensibility, and high performance.
- Go (version 1.19 or later).
- A basic understanding of Go programming and database concepts.
- Clone the repository:
git clone https://github.com/Anthony4m/ultraSQL.git cd ultraSQL
- Install dependencies:
go mod tidy
To run the application:
go run main.go
To test the implementation:
go test ./...
package main
import "ultrasql"
func main() {
db := ultrasql.New()
// Create table
db.CreateTable("users", []string{"id", "name"})
// Insert data
db.Insert("users", []interface{}{1, "John Doe"})
db.Insert("users", []interface{}{2, "Jane Smith"})
// Query data
rows := db.Query("SELECT * FROM users WHERE id = 1")
fmt.Println(rows)
// Transaction Example
tx := db.BeginTransaction()
tx.Insert("users", []interface{}{3, "Alice Johnson"})
tx.Commit()
}
.
├── kfile/ # Core file handling and storage management
├── log/ # Logging utilities
├── mydb/ # Core database engine and operations
├── utils/ # Shared utility functions and helpers
├── .gitignore # Specifies files ignored by Git
├── README.md # Project overview and usage instructions
├── go.mod # Go module dependencies
└── main.go # Main entry point for running the application
- Learning Tool: Understand database internals and Go development.
- Prototyping: Quickly build data-driven applications.
- Embedded Database: Lightweight storage solution for small-scale projects.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch:
git checkout -b feature-name
. - Commit your changes:
git commit -m "Add feature-name"
. - Push to the branch:
git push origin feature-name
. - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Inspired by lightweight database implementations.
- Special thanks to the Go community for their invaluable resources.