This repository has been archived by the owner on Sep 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
database.go
75 lines (59 loc) · 2.38 KB
/
database.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package mock
// DatabaseService mock implementation.
type DatabaseService struct{}
// Configure establishes a new database connection
func (service *DatabaseService) Configure() {
}
// CheckTable ensures a the table exists for the persistor.
func (service *DatabaseService) CheckTable(entity interface{}) error {
return nil
}
// Raw executes a string of SQL.
func (service *DatabaseService) Raw(query interface{}, params ...interface{}) error {
return nil
}
// Find will check if the model exists and run the additional functionality.
func (service *DatabaseService) Find(query interface{}, callback func(query interface{})) {
}
// FindAll instances of a type of model.
func (service *DatabaseService) FindAll(model interface{}) error {
return nil
}
// Where is a conditional selection based on the model in the data store.
func (service *DatabaseService) Where(model interface{}, condition string, params ...interface{}) error {
return nil
}
// ColumnsWhere is a Conditional selection based on the model in the data store only returning specific quoted columns.
func (service *DatabaseService) ColumnsWhere(model interface{}, columns []string, condition string, params ...interface{}) error {
return nil
}
// Count return the number of rows found.
func (service *DatabaseService) Count(model interface{}, condition string, params ...interface{}) int {
return 0
}
// CountExpr return the number of rows found with an expression.
func (service *DatabaseService) CountExpr(model interface{}, expr string, retval interface{}, condition string, params ...interface{}) {
}
// Array fills an array from the model and expression.
func (service *DatabaseService) Array(model interface{}, expr string, retval interface{}, condition string, params ...interface{}) {
}
// Insert persists the new model in the data store
func (service *DatabaseService) Insert(query ...interface{}) error {
return nil
}
// Update persists the existing model in the data store
func (service *DatabaseService) Update(query interface{}) error {
return nil
}
// Save persists the model in the data store
func (service *DatabaseService) Save(query ...interface{}) error {
return nil
}
// Delete removes the model from the data store
func (service *DatabaseService) Delete(query interface{}) error {
return nil
}
// Select returns the model from the data store
func (service *DatabaseService) Select(query interface{}) error {
return nil
}