diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2026-09-17 16:21:40 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2026-09-17 16:21:40 +0200 |
| commit | 63df99f2e1c742069464d219a9f340c1f8f5bd90 (patch) | |
| tree | b64e6742c78e0d7e4bac1d6f3ed8a2c03f2f9c9b /oblast/README.md | |
| parent | fe37a82d0495a8b59b80677dd42d0d94ffafdfb4 (diff) | |
| download | go-gg-63df99f2e1c742069464d219a9f340c1f8f5bd90.tar.gz | |
oblast: import from go.xyrillian.de/oblast
- type RuntimeIndex is left behind for now because I don't want to
commit to the method names yet
- the "OrNone" methods are removed in favor of gsql.NoneIfNoRows()
Diffstat (limited to 'oblast/README.md')
| -rw-r--r-- | oblast/README.md | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/oblast/README.md b/oblast/README.md new file mode 100644 index 0000000..d4e3b73 --- /dev/null +++ b/oblast/README.md @@ -0,0 +1,41 @@ +<!-- +SPDX-FileCopyrightText: 2026 Stefan Majewsky <majewsky@gmx.net> +SPDX-License-Identifier: Apache-2.0 +--> + +# Oblast + +A small ORM library for Go, focused on type safety and performance. Inspired by [Gorp](https://pkg.go.dev/gopkg.in/gorp.v3), but without the bits that make Gorp slow. + +You may think that the name refers to the type of administrative division that exists in several Slavic countries, but it's actually just an acronym for what this library does: **Ob**ject **L**oading **A**nd **St**oring. + +## How to use + +Please refer to the [package documentation](https://pkg.go.dev/go.xyrillian.de/gg/oblast). + +## How to contribute + +Please refer to the [README on module level](https://pkg.go.dev/go.xyrillian.de/gg). + +## Design goals and priorities + +The design goals, ordered by priority (most important comes first), are: + +- An intuitive API that encodes type safety through the use of generics. +- A minimal amount of memory allocations in hot paths. +- A minimal amount of CPU usage. +- As few library dependencies as possible. + +Explicit non-goals include: + +- A fully featured API for query construction: + Oblast does not offer methods like `table.Where("created_at < ?", time.Now()).Order("name").Join("products")`; it only deals with mapping between database columns and fields of struct types, nothing else. + This is not just a question of performance. + The author of this library does not believe that it is worthwhile to have an API like this. + Writing SQL queries by hand is significantly simpler, and does not take away any convenience, except for rare edge cases. +- Support for schema generation or manipulation: + Another thing that the author of this library does not believe to be worthwhile in an ORM library. + In real-world applications, you will need to manage the schema using versioned schema migrations. + Schemas generated by ORM libraries from type declarations cannot really offer this, especially once you get into stored functions, triggers and so on. + +The author realizes that this means that Oblast is technically only an OM library, not an ORM library. Sometimes, optimization means getting rid of on of th lttrs. |
