Skip to content

Release v0.8.0: Named Placeholders, Quoting, Row/Column, Transactional, Distinct, AndWhere/OrWhere#7

Merged
kolkov merged 2 commits intomainfrom
develop
Dec 16, 2025
Merged

Release v0.8.0: Named Placeholders, Quoting, Row/Column, Transactional, Distinct, AndWhere/OrWhere#7
kolkov merged 2 commits intomainfrom
develop

Conversation

@kolkov
Copy link
Contributor

@kolkov kolkov commented Dec 16, 2025

Summary

Release v0.8.0 implements 6 new features based on ozzo-dbx API analysis:

  • TASK-010: Named placeholders {:name} with Bind(Params{})
  • TASK-011: Table/column quoting {{table}} [[column]]
  • TASK-012: Row() and Column() methods for scalar results
  • TASK-013: Transactional() helper with auto commit/rollback and panic recovery
  • TASK-014: Distinct() method for SELECT DISTINCT
  • TASK-015: AndWhere() and OrWhere() for dynamic WHERE building

New API Examples

// Named placeholders
db.NewQuery("SELECT * FROM users WHERE id={:id}").
    Bind(relica.Params{"id": 1}).All(&users)

// Table/column quoting
db.NewQuery("SELECT [[name]] FROM {{users}}").All(&names)

// Row/Column for scalar results
var count int
db.Select("COUNT(*)").From("users").Row(&count)

// Transactional helper
db.Transactional(ctx, func(tx *relica.Tx) error {
    return tx.Model(&user).Insert()
})

// DISTINCT
db.Select("category").From("products").Distinct(true).All(&cats)

// Dynamic WHERE
q := db.Select("*").From("users").Where("status = ?", 1)
q = q.AndWhere(relica.Like("name", "%john%"))
q = q.OrWhere(relica.Eq("role", "admin"))

Quality

  • All tests pass (600+)
  • golangci-lint: 0 issues
  • pre-release.sh: PASS
  • 14 files changed, 3874 insertions

Test plan

  • Unit tests for all new features
  • Linter validation
  • Pre-release script passed
  • CI checks on PR

@codecov
Copy link

codecov bot commented Dec 16, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

Features:
- Named placeholders {:name} with Bind(Params{})
- Quoting syntax {{table}} and [[column]]
- Row() / Column() scalar query helpers
- Transactional() auto commit/rollback
- Distinct() SELECT DISTINCT support
- AndWhere() / OrWhere() dynamic WHERE building

Also:
- Updated CHANGELOG, README, ROADMAP
- CI: simplified triggers (push to main only, PRs for all)
@kolkov kolkov merged commit c18bc61 into main Dec 16, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant