Skip to content

Commit

Permalink
Rewrite files
Browse files Browse the repository at this point in the history
  • Loading branch information
liudng committed Aug 16, 2015
1 parent e2634d9 commit 5d32e88
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ORM library for golang
# ORM library

Supported databases include MySQL, MariaDB, PostgreSQL, Sqlite3.

Expand Down
28 changes: 0 additions & 28 deletions condition.go

This file was deleted.

12 changes: 12 additions & 0 deletions query.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ type Result struct {
RowsAffected int64
}

// Condition struct
type Condition struct {
Eq map[string]string `json:"eq"`
Ge map[string]string `json:"ge"`
Gt map[string]string `json:"gt"`
Le map[string]string `json:"le"`
Lt map[string]string `json:"lt"`
Ne map[string]string `json:"ne"`
Like map[string]string `json:"like"`
In map[string][]string `json:"in"`
}

// Equal
func (q *Query) Eq(f string, v interface{}) string {
return q.condition("", f, "=", v)
Expand Down
8 changes: 4 additions & 4 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ import (
// Server struct
type Server struct {
// Name
Name string
Name string `json:"name"`

// Database type: mysql postgresql or sqlite3
Type string
Type string `json:"type"`

// Data Source Name
DSN string
DSN string `json:"dsn"`

// Follow
Follow string
Follow string `json:"follow"`
}

// Execute query, only return sql.Result
Expand Down

0 comments on commit 5d32e88

Please sign in to comment.