The Go driver for MongoDB

docs docs

MongoDB Go Driver

The MongoDB supported driver for Go.



Requirements

  • Go 1.10 or higher. We aim to support the latest supported versions of go.
  • MongoDB 2.6 and higher.

Installation

The recommended way to get started using the MongoDB Go driver is by using go modules to install the dependency in your project. This can be done either by importing packages from go.mongodb.org/mongo-driver and having the build step install the dependency or by explicitly running

go get go.mongodb.org/mongo-driver/mongo

When using a version of Go that does not support modules, the driver can be installed using dep by running

dep ensure -add "go.mongodb.org/mongo-driver/mongo"

Usage

To get started with the driver, import the mongo package and create a mongo.Client with the Connect function:

import (
    "go.mongodb.org/mongo-driver/mongo"
    "go.mongodb.org/mongo-driver/mongo/options"
    "go.mongodb.org/mongo-driver/mongo/readpref"
)

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
client, err := mongo.Connect(ctx, options.Client().ApplyURI("mongodb://localhost:27017"))

Make sure to defer a call to Disconnect after instantiating your client:

defer func() {
    if err = client.Disconnect(ctx); err != nil {
        panic(err)
    }
}()

For more advanced configuration and authentication, see the documentation for mongo.Connect.

Calling Connect does not block for server discovery. If you wish to know if a MongoDB server has been found and connected to, use the Ping method:

ctx, cancel = context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
err = client.Ping(ctx, readpref.Primary())

To insert a document into a collection, first retrieve a Database and then Collection instance from the Client:

collection := client.Database("testing").Collection("numbers")

The Collection instance can then be used to insert documents:

ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
res, err := collection.InsertOne(ctx, bson.D{{"name", "pi"}, {"value", 3.14159}})
id := res.InsertedID

To use bson.D, you will need to add "go.mongodb.org/mongo-driver/bson" to your imports.

Your import statement should now look like this:

import (
    "go.mongodb.org/mongo-driver/bson"
    "go.mongodb.org/mongo-driver/mongo"
    "go.mongodb.org/mongo-driver/mongo/options"
    "go.mongodb.org/mongo-driver/mongo/readpref"
)

Several query methods return a cursor, which can be used like this:

ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
cur, err := collection.Find(ctx, bson.D{})
if err != nil { log.Fatal(err) }
defer cur.Close(ctx)
for cur.Next(ctx) {
   var result bson.D
   err := cur.Decode(&result)
   if err != nil { log.Fatal(err) }
   // do something with result....
}
if err := cur.Err(); err != nil {
  log.Fatal(err)
}

For methods that return a single item, a SingleResult instance is returned:

var result struct {
    Value float64
}
filter := bson.D{{"name", "pi"}}
ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
err = collection.FindOne(ctx, filter).Decode(&result)
if err != nil {
    log.Fatal(err)
}
// Do something with result...

Additional examples and documentation can be found under the examples directory and on the MongoDB Documentation website.


Feedback

For help with the driver, please post in the MongoDB Community Forums.

New features and bugs can be reported on jira: https://jira.mongodb.org/browse/GODRIVER


Testing / Development

The driver tests can be run against several database configurations. The most simple configuration is a standalone mongod with no auth, no ssl, and no compression. To run these basic driver tests, make sure a standalone MongoDB server instance is running at localhost:27017. To run the tests, you can run make (on Windows, run nmake). This will run coverage, run go-lint, run go-vet, and build the examples.

Testing Different Topologies

To test a replica set or sharded cluster, set MONGODB_URI="<connection-string>" for the make command. For example, for a local replica set named rs1 comprised of three nodes on ports 27017, 27018, and 27019:

MONGODB_URI="mongodb://localhost:27017,localhost:27018,localhost:27018/?replicaSet=rs1" make

Testing Auth and TLS

To test authentication and TLS, first set up a MongoDB cluster with auth and TLS configured. Testing authentication requires a user with the root role on the admin database. The Go Driver repository comes with example certificates in the data/certificates directory. These certs can be used for testing. Here is an example command that would run a mongod with TLS correctly configured for tests:

mongod \
--auth \
--tlsMode requireTLS \
--tlsCertificateKeyFile $(pwd)/data/certificates/server.pem \
--tlsCAFile $(pwd)/data/certificates/ca.pem \
--tlsAllowInvalidCertificates

To run the tests with make, set MONGO_GO_DRIVER_CA_FILE to the location of the CA file used by the database, set MONGODB_URI to the connection string of the server, set AUTH=auth, and set SSL=ssl. For example:

AUTH=auth SSL=ssl MONGO_GO_DRIVER_CA_FILE=$(pwd)/data/certificates/ca.pem  MONGODB_URI="mongodb://user:password@localhost:27017/?authSource=admin" make

Notes:

  • The --tlsAllowInvalidCertificates flag is required on the server for the test suite to work correctly.
  • The test suite requires the auth database to be set with ?authSource=admin, not /admin.

Testing Compression

The MongoDB Go Driver supports wire protocol compression using Snappy, zLib, or zstd. To run tests with wire protocol compression, set MONGO_GO_DRIVER_COMPRESSOR to snappy, zlib, or zstd. For example:

MONGO_GO_DRIVER_COMPRESSOR=snappy make

Ensure the --networkMessageCompressors flag on mongod or mongos includes zlib if testing zLib compression.


Contribution

Check out the project page for tickets that need completing. See our contribution guidelines for details.


Continuous Integration

Commits to master are run automatically on evergreen.


Thanks and Acknowledgement

@ashleymcnamara - Mongo Gopher Artwork


License

The MongoDB Go Driver is licensed under the Apache License.

Comments
  • GODRIVER-567 Returned time.Time instead of int64 when decoding an IsoDate

    GODRIVER-567 Returned time.Time instead of int64 when decoding an IsoDate

    Hi, the value returned in case of null time is an empty time.Time struct, when teh time is not null, however, an int64 is returned, which makes no sense and prevents from decoding an ISODate into time.Time

    There was no test for a non empty Time value, so I added it.

    This is for teh JIRA ticket GODRIVER-567

  • Fix bsoncore overflow

    Fix bsoncore overflow

    Hello, we were fuzzing one of our libraries that depend on bsonx and found following panics

    panic: runtime error: index out of range [-1]
    
    goroutine 1 [running]:
    go.mongodb.org/mongo-driver/x/bsonx/bsoncore.Document.Validate(0x4381000, 0x4, 0x4, 0x12dad00, 0xc0000102c0)
    	XXXX/mongo-driver/x/bsonx/bsoncore/document.go:373 +0x6e3
    go.mongodb.org/mongo-driver/x/bsonx.(*Doc).UnmarshalBSON(0xc0000cbe08, 0x4381000, 0x4, 0x4, 0xc0000cbe08, 0x99c4e6fa)
    	XXXX/mongo-driver/x/bsonx/document.go:225 +0xb6
    go.mongodb.org/mongo-driver/x/bsonx.ReadDoc(0x4381000, 0x4, 0x4, 0xc0000cbe70, 0x1076066, 0x5dcdd198, 0xdc8138, 0x133fa99c4e6fa)
    
    XXXXXXXXXXXXXXXX
    
    exit status 2
    
    ----------
    
    panic: runtime error: slice bounds out of range [:-2147483643]
    
    goroutine 1 [running]:
    go.mongodb.org/mongo-driver/x/bsonx/bsoncore.ReadElement(0x4221004, 0x6, 0x6, 0xc000000006, 0x4221004, 0x6, 0x6, 0x1, 0x9, 0x4221004)
    	XXXX/mongo-driver/x/bsonx/bsoncore/bsoncore.go:126 +0x3c8
    go.mongodb.org/mongo-driver/x/bsonx/bsoncore.Document.Validate(0x4221000, 0xa, 0xa, 0x12dad20, 0xc0000c20a0)
    	XXXX/mongo-driver/x/bsonx/bsoncore/document.go:381 +0x208
    go.mongodb.org/mongo-driver/x/bsonx.(*Doc).UnmarshalBSON(0xc0000cbe08, 0x4221000, 0xa, 0xa, 0xc0000cbe08, 0x87888daf)
    	XXXX/mongo-driver/x/bsonx/document.go:225 +0xb6
    
    XXXXXXXXXXXXXXXX
    
    exit status 2
    

    This PR should fix that.

  • Add go module support

    Add go module support

    It would be really useful to have support for go modules. This PR just adds the go.mod and go.sum needed for modules support. Tagging commit 1c3b9b9a41eecdf056560e07b68e6407b8d598c3 as v1.0.0 is also required (but can't be done via a PR).

  • GODRIVER-2233 Bump packr/v2 dependency version to avoid vulnerability

    GODRIVER-2233 Bump packr/v2 dependency version to avoid vulnerability

    This PR simply bumps up the version of the github.com/gobuffalo/packr/v2 dependency to be version 2.8.1.

    This change is being made to address a security vulnerability that has been reported by Snyk: https://security.snyk.io/vuln/SNYK-GOLANG-GITHUBCOMGOBUFFALOPACKRV2-1920670 The remediation for this vulnerability is to use version 2.3.2 or higher of the packr package.

  • GODRIVER-2161 Add NewSingleResultFromDocument and NewCursorFromDocuments functions

    GODRIVER-2161 Add NewSingleResultFromDocument and NewCursorFromDocuments functions

    GODRIVER-2161

    Adds a new SingleResult constructor NewSingleResultFromDocument that makes a SingleResult with an underlying Cursor pre-loaded with a singleton slice of documents ([]interface{}{document}) as the first batch. Adds a new Cursor construct NewCursorFromDocuments that makes a Cursor pre-loaded with a slice of documents ([]interface{}) as the first batch. These new functions can be used to mock server responses to read operations (e.g. Find, FindOne, Aggregate). Adds associated unit and integration tests.

  • Fix panic on ARM, 386, and 32-bit MIPS by aligne fileds used by atomic package

    Fix panic on ARM, 386, and 32-bit MIPS by aligne fileds used by atomic package

    When I tried to use my program on ARM I got panic:

    (...)
    panic: unaligned 64-bit atomic operation [recovered]
            panic: unaligned 64-bit atomic operation
    
    goroutine 1 [running]:
    github.com/alecthomas/kong.catch(0x2cb1f58)
            /home/sr/go/pkg/mod/github.com/alecthomas/[email protected]/kong.go:407 +0xa8
    panic(0x6b9540, 0x8b0528)
            /usr/lib/go/src/runtime/panic.go:965 +0x174
    runtime/internal/atomic.panicUnaligned()
            /usr/lib/go/src/runtime/internal/atomic/unaligned.go:8 +0x24
    runtime/internal/atomic.Xadd64(0x2c77b14, 0x1, 0x0, 0x7, 0xc)
            /usr/lib/go/src/runtime/internal/atomic/asm_arm.s:233 +0x14
    go.mongodb.org/mongo-driver/x/mongo/driver/topology.(*pool).makeNewConnection(0x2c77ae0, 0x2d62c01, 0x0, 0x1, 0x0, 0x0)
            /home/sr/go/pkg/mod/go.mongodb.org/[email protected]/x/mongo/driver/topology/pool.go:287 +0x94
    go.mongodb.org/mongo-driver/x/mongo/driver/topology.(*pool).get(0x2c77ae0, 0x8bc73c, 0x2cf99c0, 0x0, 0x0, 0x2cc8988)
            /home/sr/go/pkg/mod/go.mongodb.org/[email protected]/x/mongo/driver/topology/pool.go:440 +0x3b0
    go.mongodb.org/mongo-driver/x/mongo/driver/topology.(*Server).Connection(0x2d96f30, 0x8bc73c, 0x2cf99c0, 0x0, 0x0, 0x0, 0x0)
            /home/sr/go/pkg/mod/go.mongodb.org/[email protected]/x/mongo/driver/topology/server.go:268 +0x5c
    go.mongodb.org/mongo-driver/x/mongo/driver.Operation.getServerAndConnection(0x2dae628, 0x752d82, 0xb, 0x8ba99c, 0x2d87580, 0x2dae630, 0x8b84d4, 0x2db3680, 0x0, 0x0, ...)
            /home/sr/go/pkg/mod/go.mongodb.org/[email protected]/x/mongo/driver/operation.go:246 +0x94
    go.mongodb.org/mongo-driver/x/mongo/driver.Operation.Execute(0x2dae628, 0x752d82, 0xb, 0x8ba99c, 0x2d87580, 0x2dae630, 0x8b84d4, 0x2db3680, 0x0, 0x0, ...)
            /home/sr/go/pkg/mod/go.mongodb.org/[email protected]/x/mongo/driver/operation.go:301 +0x80
    go.mongodb.org/mongo-driver/x/mongo/driver/operation.(*Insert).Execute(0x2d9aea0, 0x8bc73c, 0x2cf99c0, 0x2dae620, 0x9f3c141e)
            /home/sr/go/pkg/mod/go.mongodb.org/[email protected]/x/mongo/driver/operation/insert.go:109 +0x1a4
    go.mongodb.org/mongo-driver/mongo.(*Collection).insert(0x2d83440, 0x8bc73c, 0x2cf99c0, 0x2cb1bf4, 0x1, 0x1, 0x2cb1be8, 0x1, 0x1, 0x0, ...)
            /home/sr/go/pkg/mod/go.mongodb.org/[email protected]/mongo/collection.go:297 +0x54c
    go.mongodb.org/mongo-driver/mongo.(*Collection).InsertOne(0x2d83440, 0x8bc73c, 0x2cf99c0, 0x690128, 0x2d9ae40, 0x0, 0x0, 0x0, 0xc0425a05, 0x82bfeb58, ...)
            /home/sr/go/pkg/mod/go.mongodb.org/[email protected]/mongo/collection.go:336 +0xd4
     (...)
    

    The atomic package has a bug section with this note:

    On ARM, 386, and 32-bit MIPS, it is the caller's responsibility to arrange for 64-bit alignment of 64-bit words accessed atomically. The first word in a variable or in an allocated struct, array, or slice can be relied upon to be 64-bit aligned.

    I have tested it with my program after change (on arm target) and it worked.

  • GODRIVER-1147 Add an API to create collections

    GODRIVER-1147 Add an API to create collections

    I ended up adding separate APIs for creating collections and views even though both use the same create command under the hood because the command doesn't have great separation of concerns. A lot of the server options (e.g. capped, valdiator, etc) do not apply when creating a view, so separate APIs made sense to me. This is also in line with what mgo did. In scope of this ticket, I also added embedded documentation examples and switched the integration testing library to use the new APIs rather than RunCommand to create collections.

    The main open question is whether or not we should include options like AutoIndexID, which was deprecated in 3.2 and removed in 4.0 for all databases besides "local". I included it becuase we still support 2.6 and 3.0, even though those have been EOLed.

  • GODRIVER-693: Fix error on decoding using a change stream cursor on a database

    GODRIVER-693: Fix error on decoding using a change stream cursor on a database

    On opening a change stream cursor for any database, whenever the cursor is used to decode, it panics on runtime.

    Generate the case using: https://gist.github.com/Shivam010/bf057e4fcf65954c62751b0e544bbd1e

    GODRIVER-693

  • Add comment to DateTime constructor

    Add comment to DateTime constructor

    Also I would like to create constructor from time.Time, if you allow me. Like that:

    // Time creates a datetime element with the given key and value.
    func (c ElementConstructor) Time(key string, time time.Time) *Element {
    	return c.DateTime(key, time.Unix() * 1000)
    }
    
  • Feature - Transaction state in session

    Feature - Transaction state in session

    Now the only possible way to check if transaction in progress (for Session interface) is to call StartTransaction, AbortTransaction or CommitTransaction method and handle errors. It is unacceptable for obvious reasons. I've added TransactionState method to Session interface.

    Use case: choosing read preference for collection method call depending on transaction status.

  • GODRIVER-2677 Limit the maximum number of items in pool.

    GODRIVER-2677 Limit the maximum number of items in pool.

    GODRIVER-2677

    Summary

    Reduce the memory consumption by setting a maximum number of items in the byte slice pool.

    Background & Motivation

    I limited 512 slices in the pool. Get() allocates directly from the system when it reaches the limit. So the size of the pool shall not be bigger than 16MB * 512 ~= 8GB in theory considering the ticket indicates ~20GB of memory consumption. I did not reset the capacity of returned byte slice because it would cause more allocations.

    The benchstat from benchmark/operation_test.go:

    name                           old time/op    new time/op    delta
    ClientWrite/not_compressed-10    2.00ms ± 9%    1.96ms ±10%     ~     (p=0.853 n=10+10)
    ClientWrite/snappy-10            2.10ms ± 8%    1.88ms ± 6%  -10.48%  (p=0.000 n=10+9)
    ClientWrite/zlib-10              2.04ms ±19%    1.84ms ±12%   -9.83%  (p=0.011 n=10+10)
    ClientWrite/zstd-10              2.02ms ±12%    1.91ms ±12%     ~     (p=0.105 n=10+10)
    
    name                           old alloc/op   new alloc/op   delta
    ClientWrite/not_compressed-10    27.7kB ± 2%    27.7kB ± 1%     ~     (p=0.579 n=10+10)
    ClientWrite/snappy-10            41.4kB ± 2%    51.4kB ± 1%  +24.19%  (p=0.000 n=10+10)
    ClientWrite/zlib-10               906kB ± 0%     914kB ± 0%   +0.81%  (p=0.000 n=10+10)
    ClientWrite/zstd-10              67.0kB ± 0%    76.7kB ± 0%  +14.49%  (p=0.000 n=10+10)
    
    name                           old allocs/op  new allocs/op  delta
    ClientWrite/not_compressed-10      79.0 ± 0%      81.5 ± 1%   +3.16%  (p=0.000 n=8+10)
    ClientWrite/snappy-10              82.0 ± 0%      88.6 ± 1%   +8.05%  (p=0.000 n=8+10)
    ClientWrite/zlib-10                 122 ± 1%       128 ± 1%   +4.99%  (p=0.000 n=10+10)
    ClientWrite/zstd-10                 183 ± 0%       188 ± 0%   +2.90%  (p=0.000 n=8+10)
    
    name                          old time/op    new time/op    delta
    ClientRead/not_compressed-10     153µs ±12%     166µs ±11%   +8.26%  (p=0.035 n=10+10)
    ClientRead/snappy-10             149µs ±14%     165µs ± 6%  +10.80%  (p=0.001 n=10+10)
    ClientRead/zlib-10               240µs ± 8%     263µs ± 2%   +9.72%  (p=0.000 n=9+9)
    ClientRead/zstd-10               130µs ± 4%     173µs ± 8%  +32.88%  (p=0.000 n=10+10)
    
    name                          old alloc/op   new alloc/op   delta
    ClientRead/not_compressed-10    29.0kB ± 0%    29.0kB ± 0%     ~     (p=0.171 n=10+10)
    ClientRead/snappy-10            45.7kB ± 0%    46.1kB ± 0%   +0.88%  (p=0.000 n=10+9)
    ClientRead/zlib-10               905kB ± 0%     906kB ± 0%   +0.17%  (p=0.000 n=8+10)
    ClientRead/zstd-10               135kB ± 0%     136kB ± 0%   +0.33%  (p=0.000 n=10+10)
    
    name                          old allocs/op  new allocs/op  delta
    ClientRead/not_compressed-10      83.0 ± 0%      85.0 ± 0%   +2.41%  (p=0.000 n=10+10)
    ClientRead/snappy-10              87.0 ± 0%      90.0 ± 0%   +3.45%  (p=0.000 n=10+10)
    ClientRead/zlib-10                 143 ± 0%       147 ± 0%   +3.08%  (p=0.000 n=9+10)
    ClientRead/zstd-10                 191 ± 0%       194 ± 0%   +1.57%  (p=0.000 n=10+10)
    
  • GODRIVER-2658 Better guard against nil pinned connections.

    GODRIVER-2658 Better guard against nil pinned connections.

    GODRIVER-2658

    Summary

    Adds ServerConnectionID() to topology.Connection to avoid panics when that method is called against &topology.Connection{}. Adds IsNil() to the driver.Connection interface to more robustly check for nil connections in driver.Connection implementations that wrap an underlying connection that may be nil. Uses the new IsNil() method to better check nilness when potentially returning pinned connections in getServerAndConnection().

    Background & Motivation

    Users are occasionally seeing panics from the ServerConnectionID() here. The driver was panic'ing because topology.Connection did not implement a ServerConnectionID() method that guarded against the underlying connection being nil. It is odd that the driver returns &topology.Connection{} from getServerAndConnection, but since this issue is only reported against serverless instances, we can just add a check to getServerAndConnection to not return the pinned connection (and continue to regular connection check out) when the PinnedConnection isn't nil but its underlying connection is (as is the case with &topology.Connection{}).

  • Add POC for reply callback

    Add POC for reply callback

    Summary

    Add a "ReplyCallback" field to the CommandMonitor struct to give users the option of altering the response of a request before it is propagated to the CommandSucceeded event.

    A use case for this would look something like the following:

    package main
    
    import (
    	"context"
    	"log"
    
    	"go.mongodb.org/mongo-driver/bson"
    	"go.mongodb.org/mongo-driver/event"
    	"go.mongodb.org/mongo-driver/mongo"
    	"go.mongodb.org/mongo-driver/mongo/options"
    	"go.mongodb.org/mongo-driver/x/bsonx/bsoncore"
    )
    
    func main() {
    	cmdMonitor := new(event.CommandMonitor)
    
    	cmdMonitor.ReplyCallback = func(ctx context.Context, rsp *bsoncore.Document) bson.Raw { 
                     return nil 
            }
    	cmdMonitor.Succeeded = func(context.Context, *event.CommandSucceededEvent) {}
    
    	ctx := context.Background()
    
    	clientOptions := options.Client().ApplyURI("mongodb://localhost:27017").SetMonitor(cmdMonitor)
    	client, err := mongo.Connect(ctx, clientOptions)
    	if err != nil {
    		log.Fatal(err)
    	}
    
    	if err = client.Ping(ctx, nil); err != nil {
    		log.Fatal(err)
    	}
    }
    

    Background & Motivation

    A user is suggesting adding a "Finished" event to the CommandMonitor in PR #1106. The user's solution may be the best solution, this PR is to explore alternatives.

  • GODRIVER-2674 use time.Duration instead of durationNanos

    GODRIVER-2674 use time.Duration instead of durationNanos

    Same as #1105

    OK make fmt
    OK make lint
    make test: go.mongodb.org/mongo-driver/mongo/integration/unified: no such command: 'configureFailPoint'
    (make test fails on master with same result)
    make test-race: same result as make test
    
  • add CommandFinishedEvent to monitor without response copies

    add CommandFinishedEvent to monitor without response copies

    Summary

    Add new event for monitoring to subscribe to operation finishes without heavy info about failure or success

    Background & Motivation

    In our busy service publishFinishedEvent func does ~100GB of allocations in 2 hours and possesses the 4th place by allocations. AFAIU these allocations are rooted to the copies of server responses which we do not use. How about allowing to subscribe to operation finish event without the details about success or failure?

    image

Mongo Go Models (mgm) is a fast and simple MongoDB ODM for Go (based on official Mongo Go Driver)
Mongo Go Models (mgm) is a fast and simple MongoDB ODM for Go (based on official Mongo Go Driver)

Mongo Go Models Important Note: We changed package name from github.com/Kamva/mgm/v3(uppercase Kamva) to github.com/kamva/mgm/v3(lowercase kamva) in v

Jan 2, 2023
The MongoDB driver for Go

The MongoDB driver for Go This fork has had a few improvements by ourselves as well as several PR's merged from the original mgo repo that are current

Jan 8, 2023
The Go driver for MongoDB
The Go driver for MongoDB

MongoDB Go Driver The MongoDB supported driver for Go. Requirements Installation Usage Bugs / Feature Reporting Testing / Development Continuous Integ

Dec 31, 2022
Go MySQL Driver is a MySQL driver for Go's (golang) database/sql package

Go-MySQL-Driver A MySQL-Driver for Go's database/sql package Features Requirements Installation Usage DSN (Data Source Name) Password Protocol Address

Jan 4, 2023
Go driver for PostgreSQL over SSH. This driver can connect to postgres on a server via SSH using the local ssh-agent, password, or private-key.

pqssh Go driver for PostgreSQL over SSH. This driver can connect to postgres on a server via SSH using the local ssh-agent, password, or private-key.

Nov 6, 2022
Simple key-value store abstraction and implementations for Go (Redis, Consul, etcd, bbolt, BadgerDB, LevelDB, Memcached, DynamoDB, S3, PostgreSQL, MongoDB, CockroachDB and many more)

gokv Simple key-value store abstraction and implementations for Go Contents Features Simple interface Implementations Value types Marshal formats Road

Dec 24, 2022
Data access layer for PostgreSQL, CockroachDB, MySQL, SQLite and MongoDB with ORM-like features.
Data access layer for PostgreSQL, CockroachDB, MySQL, SQLite and MongoDB with ORM-like features.

upper/db is a productive data access layer (DAL) for Go that provides agnostic tools to work with different data sources

Jan 3, 2023
💲 Golang, Go Fiber, RabbitMQ, MongoDB, Docker, Kubernetes, GitHub Actions
💲 Golang, Go Fiber, RabbitMQ, MongoDB, Docker, Kubernetes, GitHub Actions

Bank Projeto para simular empréstimos financeiros em um banco para clientes Tecnologias Utilizadas Golang MongoDB RabbitMQ Github Actions Docker Hub D

Dec 9, 2022
Examples and code to assign a name to your MongoDB, MySQL, PostgreSQL, RabbitMQ, and redis connection.
Examples and code to assign a name to your MongoDB, MySQL, PostgreSQL, RabbitMQ, and redis connection.

your connection deserves a name ?? When your app interacts with an external system, assign a name to the connection. An external system in this contex

Dec 14, 2022
A MongoDB compatible embeddable database and toolkit for Go.
A MongoDB compatible embeddable database and toolkit for Go.

lungo A MongoDB compatible embeddable database and toolkit for Go. Installation Example Motivation Architecture Features License Installation To get s

Jan 3, 2023
Go-odm, a Golang Object Document Mapping for MongoDB.
Go-odm, a Golang Object Document Mapping for MongoDB.

A project of SENROK Open Source Go ODM Go-odm, a Golang Object Document Mapping for MongoDB. Table of contents Features Installation Get started Docum

Nov 4, 2022
Golang MongoDB Integration Examples

Get Program Get a copy of the program: git clone https://github.com/hmdhszd/Go

Feb 1, 2022
Mirror of Apache Calcite - Avatica Go SQL Driver

Apache Avatica/Phoenix SQL Driver Apache Calcite's Avatica Go is a Go database/sql driver for the Avatica server. Avatica is a sub-project of Apache C

Nov 3, 2022
Firebird RDBMS sql driver for Go (golang)

firebirdsql (Go firebird sql driver) Firebird RDBMS http://firebirdsql.org SQL driver for Go Requirements Firebird 2.5 or higher Golang 1.13 or higher

Dec 20, 2022
Microsoft ActiveX Object DataBase driver for go that using exp/sql

go-adodb Microsoft ADODB driver conforming to the built-in database/sql interface Installation This package can be installed with the go get command:

Dec 30, 2022
Microsoft SQL server driver written in go language

A pure Go MSSQL driver for Go's database/sql package Install Requires Go 1.8 or above. Install with go get github.com/denisenkom/go-mssqldb . Connecti

Dec 26, 2022
Oracle driver for Go using database/sql

go-oci8 Description Golang Oracle database driver conforming to the Go database/sql interface Installation Install Oracle full client or Instant Clien

Dec 30, 2022
sqlite3 driver for go using database/sql

go-sqlite3 Latest stable version is v1.14 or later not v2. NOTE: The increase to v2 was an accident. There were no major changes or features. Descript

Jan 8, 2023
GO DRiver for ORacle DB

Go DRiver for ORacle godror is a package which is a database/sql/driver.Driver for connecting to Oracle DB, using Anthony Tuininga's excellent OCI wra

Jan 5, 2023