Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ gosqlx analyze "SELECT COUNT(*) FROM orders GROUP BY status"

# Parse SQL to AST representation
gosqlx parse -f json complex_query.sql

# Unix Pipeline Support (NEW in v1.5.0)
cat query.sql | gosqlx format # Format from stdin
echo "SELECT * FROM users" | gosqlx validate # Validate from pipe
gosqlx format query.sql | gosqlx validate # Chain commands
cat *.sql | gosqlx format | tee formatted.sql # Pipeline composition
```

### Library Usage - Simple API
Expand Down
18 changes: 18 additions & 0 deletions examples/getting-started/01-hello-world/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Hello World - The simplest GoSQLX example
//
// This example shows the absolute minimum code needed to parse SQL with GoSQLX.
// Perfect for beginners!
//
// Run: go run main.go

package main

import "github.com/ajitpratap0/GoSQLX/pkg/gosqlx"

func main() {
ast, _ := gosqlx.Parse("SELECT * FROM users")
println("Parsed successfully!")

// Let's also print the number of statements
println("Statements parsed:", len(ast.Statements))
}
Loading