Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/s4kibs4mi/jally-orm
An ORM library for Cassandra and ScyllaDB written in Golang.
https://github.com/s4kibs4mi/jally-orm
cassandra cassandra-cql golang golang-library orm orm-library scylladb
Last synced: 23 days ago
JSON representation
An ORM library for Cassandra and ScyllaDB written in Golang.
- Host: GitHub
- URL: https://github.com/s4kibs4mi/jally-orm
- Owner: s4kibs4mi
- License: mit
- Created: 2018-03-27T12:38:49.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-05T12:56:58.000Z (almost 7 years ago)
- Last Synced: 2024-11-17T15:33:29.257Z (3 months ago)
- Topics: cassandra, cassandra-cql, golang, golang-library, orm, orm-library, scylladb
- Language: Go
- Size: 14.6 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JallyORM
An ORM library for Cassandra and ScyllaDB written in Golang.Status : Development ongoing
### Examples,
Connect,
```go
config := gocql.NewCluster("localhost:9042")
config.Consistency = gocql.Quorum
config.Keyspace = "test"config.Timeout = 5 * time.Second
config.PoolConfig = gocql.PoolConfig{
HostSelectionPolicy: gocql.RoundRobinHostPolicy(),
}
config.NumConns = 5
orm, err := NewSession(config)
```Sample Struct,
```go
type Student struct {
ID gocql.UUID `json:"id" jorm:"primary_key"`
Name string `json:"name"`
Roll int `json:"roll"`
CGPA float32 `json:"cgpa"`
IsPresent bool `json:"is_present"`
CreatedAt time.Time `json:"created_at"`
}
```Create Table,
```go
orm, err := NewSession(config)
if err != nil {
panic(err)
}
s := Student{}
q := NewQuery().Space("test").Table("students").Model(s)
err = orm.Create(q)
```Insert value,
```go
orm, err := NewSession(config)
if err != nil {
panic(err)
}
s := Student{
ID: gocql.TimeUUID(),
Name: "Sakib",
Roll: 12345,
CGPA: 3.50,
IsPresent: true,
CreatedAt: time.Now(),
}
q := NewQuery().Space("test").Table("students").Model(s)
err = orm.Save(q)
```#### License
Copyright © Sakib SamiDistributed under [MIT](https://github.com/s4kibs4mi/jally-orm/blob/master/LICENSE) license