stonesql/README.md
Rene Nochebuena 27f3d59a70
All checks were successful
Go CI/CD / go-ci (push) Successful in 19m38s
Go CI/CD / go-ci (pull_request) Successful in 19m33s
Add StoneSQL migration engine with tests and README updates
Introduce the StoneSQL migration engine with embedded SQL migration support, scientific error tracking, and extensive documentation in the README. Include implementation of core functionality, error handling, and unit tests to validate success and failure scenarios.
2025-04-13 10:53:49 -06:00

82 lines
2.2 KiB
Markdown

# StoneSQL - **10 BILLION% MIGRATION PRECISION!**
Ultimate SQL Migration Engine! ⚑ Scientific database versioning with atomic precision. Embedded migration files, error tracking & stone-utils integration. 10 billion% more reliable schema changes! πŸš€
[![Kingdom of Science Approved](https://img.shields.io/badge/Approved%20By-Kingdom%20of%20Science-blueviolet)]()
[![MIGRATION MASTER](https://img.shields.io/badge/Schema_Evolution-SO_BADASS!-blueviolet)]()
[![10 BILLION](https://img.shields.io/badge/Reliability-10_Billion%25-blueviolet)]()
## πŸš€ Why StoneSQL?
- **Embedded SQL migrations** with atomic precision
- **Scientifically versioned** schema changes
- **100% reproducible** database states
- **10 billion schema changes/sec** (theoretical)
## πŸ’₯ Installation
```bash
go get gitstormr.dev/stone-utils/stonesql@latest
```
## ⚑ Basic Usage
```go
package main
import (
"embed"
"gitstormr.dev/stone-utils/stonesql"
)
//go:embed migrations/*.sql
var migrations embed.FS
type DBMigrator struct{}
func (m *DBMigrator) ExecuteMigration(ctx context.Context, name, sql string) error {
// Execute with your favorite database driver
return nil
}
func main() {
if err := stonesql.RunMigrations(context.Background(), &DBMigrator{}, migrations, "migrations"); err != nil {
panic(err) // Handle error properly in production!
}
}
```
## πŸ”¬ Core Features
### Embedded migration files
```text
migrations/
β”œβ”€ 001_init.sql
β”œβ”€ 002_add_users.sql
└─ 003_add_indexes.sql
```
### Scientific error tracking
```go
ErrWalkDirFailed = stoneerror.New(2001, "failed walking migrations")
ErrReadMigrationFailed = stoneerror.New(2002, "failed reading SQL file")
// ...and more!
```
## βš—οΈ Scientific Benchmarks
| METRIC | STANDARD LIB | STONESQL |
|-----------------|---------------|----------|
| Reliability | 80% | 10B% |
| Reproducibility | ❌ | βœ…βœ…βœ… |
| Atomicity | Maybe | ALWAYS |
**Join the Scientific Revolution!**
> "This isn't just schema management - it's revolutionizing database evolution like we revived civilization!" - Senku Ishigami
Kingdom of Science Approved
(Now with 100% more Chrome screaming "SO BADASS!")