Categorygithub.com/frazercomputing/upper-io-db
modulepackage
0.9.1
Repository: https://github.com/frazercomputing/upper-io-db.git
Documentation: pkg.go.dev

# README

upper.io/db.v2 Build Status GoDoc

The db.v2 package

The upper.io/db.v2 package for Go it's not an ORM, just a productive data access layer for Go which provides a common interface to work with different data sources such as PostgreSQL, MySQL, SQLite, QL and MongoDB.

go get upper.io/db.v2

User documentation

This is the source code repository, see examples and documentation at upper.io/db.v2.

This is not the most recent version of our source code, if you're looking for v2's source check out the v2 branch.

Looking for v1?

We're phasing out v1, if you're a new user we encourage you to use v2 instead.

Please note that the old import path upper.io/db will keep on working for a while, but we'll remove it eventually in favor of the versioned import path: upper.io/db.v2 or upper.io/db.v1.

Nevertheless, v1's docs could still be consulted at https://upper.io/db.v1.

License

This project is licensed under the terms of the MIT License.

Copyright (c) 2012-present The upper.io/db authors. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Authors and contributors

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

Host converts the given name into a host structure.
HostPort converts the given name and port into a host structure.
Open configures a database session using the given adapter's name and the provided settings.
ParseAddress parses s into a host or socket structures.
Register associates an adapter's name with a type.
Socket converts the given name into a socket structure.

# Constants

EnvEnableDebug may be used by adapters to determine if the user has enabled debugging.

# Variables

Shared error messages.
Deprecated but kept for backwards compatibility.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.
Shared error messages.

# Structs

Func is a struct that represents database functions.
HostAddr is the name or IP of a server coupled with an optional port number.
Raw holds chunks of data to be passed to the database without any filtering.
Settings holds database connection and authentication data.
SocketAddr is a UNIX address.

# Interfaces

Address is an interface that represents the host part of an URL.
Collection is an interface that defines methods for handling data sources or tables.
ConnectionURL is the interface that defines methods for connection strings.
Constrainer is the interface implemented by structs that can delimit themselves.
Database is an interface that defines methods that must be provided by database adapters.
IDSetter is the interface implemented by structs that can set their own ID after calling Append().
Int64IDSetter implements a common pattern for setting int64 IDs.
Marshaler is the interface implemented by structs that can marshal themselves into data suitable for storage.
Result is an interface that defines methods for working with result sets.
Tx is an interface that provides the same methods that the `db.Database` does, plus some other that help the user deal with database transactions.
Uint64IDSetter implements a common pattern for setting uint64 IDs.
Unmarshaler is the interface implemented by structs that can transform themselves from storage data into a valid value.

# Type aliases

And is an array of interfaces that is used to join two or more expressions under logical conjunction, it accepts `db.Cond{}`, `db.Or{}`, `db.Raw{}` and other `db.And{}` values.
Cond is a map used to define conditions passed to `db.Collection.Find()` and `db.Result.Where()`.
Or is an array of interfaced that is used to join two or more expressions under logical disjunction, it accepts `db.Cond{}`, `db.And{}`, `db.Raw{}` and other `db.Or{}` values.