![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/timt-unity3d/dsc
This library is compatible with Go 1.10+
Please refer to CHANGELOG.md
if you encounter breaking changes.
This library was developed as part of dsunit (Datastore unit testibility library) to provide unified access to SQL, noSQL, or any other store that deals with structured data in SQL-ish way.
The following is a very simple example of CRUD operations with dsc
package main
import (
)
func main() {
config := dsc.NewConfig("mysql", "[user]:[password]@[url]", "user:root,password:dev,url:tcp(127.0.0.1:3306)/mydb?parseTime=true")
factory := NewManagerFactory()
manager, err := factory.Create(config)
if err != nil {
panic(err.Error())
}
// manager := factory.CreateFromURL("file:///etc/myapp/datastore.json")
interest := Interest{}
success, err:= manager.ReadSingle(&interest, SELECT id, name, expiry, category FROM interests WHERE id = ?", []interface{}{id},nil)
if err != nil {
panic(err.Error())
}
var intersts = make([]Interest, 0)
err:= manager.ReadAll(&interests, SELECT id, name, expiry, category FROM interests", nil ,nil)
if err != nil {
panic(err.Error())
}
intersts := []Interest {
Interest{Name:"Abc", ExpiryTimeInSecond:3600, Category:"xyz"},
Interest{Name:"Def", ExpiryTimeInSecond:3600, Category:"xyz"},
Interest{Id:20, Name:"Ghi", ExpiryTimeInSecond:3600, Category:"xyz"},
}
inserted, updated, err:= manager.PersistAll(&intersts, "interests", nil)
if err != nil {
panic(err.Error())
}
deleted, err := manager.DeleteAll(&intersts, "intersts", nil)
if err != nil {
panic(err.Error())
}
fmt.Printf("Inserted %v, updated: %v\n", deleted)
}
More examples illustrating the use of the API are located in the
examples
directory.
Details about the API are available in the docs
directory.
Go version v1.5+ is required.
To install the latest stable version of Go, visit http://golang.org/dl/
Target
GOPATH
: go get github.com/viant/dsc
go get -u github.com/viant/dsc
go run <filename.go>
go build -o <output> <filename.go>
API documentation is available in the docs
directory.
This library is packaged with a number of tests. Tests require Testify library.
Before running the tests, you need to update the dependencies:
$ go get .
To run all the test cases with race detection:
$ go test
A simple CRUD applications is provided in the examples
directory.
The source code is made available under the terms of the Apache License, Version 2, as stated in the file LICENSE
.
Individual files may be made available under their own specific license, all compatible with Apache License, Version 2. Please see individual files for details.
Library Author: Adrian Witas
Contributors: Sudhakaran Dharmaraj
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.