![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
github.com/madflojo/hord
Package hord provides a simple and extensible interface for interacting with various database systems in a uniform way.
Hord is designed to be a database-agnostic library that provides a common interface for interacting with different database systems. It allows developers to write code that is decoupled from the underlying database technology, making it easier to switch between databases or support multiple databases in the same application.
mock
package, which can be used for testing purposes. The mock
driver allows users to define custom functions executed when calling the Database
interface methods, making it easier to test code that relies on the Hord interface.Database | Support | Comments | Protocol Compatible Alternatives |
---|---|---|---|
BoltDB | ✅ | ||
Cassandra | ✅ | ScyllaDB, YugabyteDB, Azure Cosmos DB | |
Hashmap | ✅ | Optionally allows storing to YAML or JSON file | |
Mock | ✅ | Mock Database interactions within unit tests | |
NATS | ✅ | Experimental | |
Redis | ✅ | Dragonfly, KeyDB |
Cache Strategy | Comments |
---|---|
Look Aside | Cache is checked before database, if not found in cache, database is checked and cache is updated |
To use Hord, import it as follows:
import "github.com/madflojo/hord"
To create a database client, you need to import and use the appropriate driver package along with the hord
package.
For example, to use the Redis driver:
import (
"github.com/madflojo/hord"
"github.com/madflojo/hord/redis"
)
func main() {
var db hord.Database
db, err := redis.Dial(redis.Config{})
if err != nil {
// Handle connection error
}
// Use the db client for database operations
// ...
}
Each driver provides its own Dial
function to establish a connection to the database. Refer to the specific driver documentation for more details.
Once you have a database client, you can use it to perform various database operations. The API is consistent across different drivers.
// Set a value
err = db.Set("key", []byte("value"))
if err != nil {
// Handle error
}
// Retrieve a value
value, err := db.Get("key")
if err != nil {
// Handle error
}
Refer to the hord.Database
interface documentation for a complete list of available methods.
Thank you for your interest in helping develop Hord. The time, skills, and perspectives you contribute to this project are valued.
Please reference our Contributing Guide for details.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.