examples/

directory
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2026 License: Apache-2.0

README

Quark ORM Examples

This directory contains real-world examples of Quark ORM usage with different database engines.

Prerequisites

To run the PostgreSQL and MySQL examples, you need to have the test databases running via Docker:

# From the project root
docker compose -f docker-compose.test.yml up -d

Running Examples

1. SQLite Example

The SQLite example is self-contained and creates a local example.db file.

go run ./examples/sqlite/main.go
2. PostgreSQL (Multi-Tenant RLS)

Demonstrates Row Level Security (RLS) isolation and automatic tenant ID injection.

go run ./examples/postgres/main.go
3. MySQL (Transactions & Streaming)

Demonstrates transactional operations and memory-efficient result streaming using Iter().

go run ./examples/mysql/main.go
4. MSSQL (Pagination & Builders)

Demonstrates pagination using the OFFSET/FETCH syntax required by SQL Server.

go run ./examples/mssql/main.go
5. Oracle (Godror Support)

Demonstrates Godror setup. Note that the Godror driver requires CGO enabled for Oracle compilation.

go run ./examples/oracle/main.go

Cleaning Up

docker compose -f docker-compose.test.yml down

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL