File tree Expand file tree Collapse file tree 3 files changed +18
-13
lines changed Expand file tree Collapse file tree 3 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,9 @@ func (commitsTable) Schema() sql.Schema {
28
28
{Name : "author_name" , Type : sql .Text , Nullable : false },
29
29
{Name : "author_email" , Type : sql .Text , Nullable : false },
30
30
{Name : "author_when" , Type : sql .Timestamp , Nullable : false },
31
- {Name : "comitter_name " , Type : sql .Text , Nullable : false },
32
- {Name : "comitter_email " , Type : sql .Text , Nullable : false },
33
- {Name : "comitter_when " , Type : sql .Timestamp , Nullable : false },
31
+ {Name : "committer_name " , Type : sql .Text , Nullable : false },
32
+ {Name : "committer_email " , Type : sql .Text , Nullable : false },
33
+ {Name : "committer_when " , Type : sql .Timestamp , Nullable : false },
34
34
{Name : "message" , Type : sql .Text , Nullable : false },
35
35
}
36
36
}
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ const (
15
15
remotesTableName = "remotes"
16
16
)
17
17
18
+ // Database holds all git repository tables
18
19
type Database struct {
19
20
name string
20
21
cr sql.Table
@@ -26,6 +27,8 @@ type Database struct {
26
27
rmr sql.Table
27
28
}
28
29
30
+ // NewDatabase creates a new Database structure and initializes its
31
+ // tables with the given pool
29
32
func NewDatabase (name string , pool * RepositoryPool ) sql.Database {
30
33
return & Database {
31
34
name : name ,
@@ -39,10 +42,12 @@ func NewDatabase(name string, pool *RepositoryPool) sql.Database {
39
42
}
40
43
}
41
44
45
+ // Name returns the name of the database
42
46
func (d * Database ) Name () string {
43
47
return d .name
44
48
}
45
49
50
+ // Tables returns a map with all initialized tables
46
51
func (d * Database ) Tables () map [string ]sql.Table {
47
52
return map [string ]sql.Table {
48
53
commitsTableName : d .cr ,
Original file line number Diff line number Diff line change @@ -59,11 +59,11 @@ func (remotesTable) Children() []sql.Node {
59
59
}
60
60
61
61
type remotesIter struct {
62
- repository_id string
63
- remotes []* git.Remote
64
- conf * gitconfig.RemoteConfig
65
- remotePos int
66
- urlPos int
62
+ repositoryID string
63
+ remotes []* git.Remote
64
+ conf * gitconfig.RemoteConfig
65
+ remotePos int
66
+ urlPos int
67
67
}
68
68
69
69
func (i * remotesIter ) NewIterator (
@@ -75,10 +75,10 @@ func (i *remotesIter) NewIterator(
75
75
}
76
76
77
77
return & remotesIter {
78
- repository_id : repo .ID ,
79
- remotes : remotes ,
80
- remotePos : 0 ,
81
- urlPos : 0 }, nil
78
+ repositoryID : repo .ID ,
79
+ remotes : remotes ,
80
+ remotePos : 0 ,
81
+ urlPos : 0 }, nil
82
82
}
83
83
84
84
func (i * remotesIter ) Next () (sql.Row , error ) {
@@ -101,7 +101,7 @@ func (i *remotesIter) Next() (sql.Row, error) {
101
101
}
102
102
103
103
row := sql .NewRow (
104
- i .repository_id ,
104
+ i .repositoryID ,
105
105
config .Name ,
106
106
config .URLs [i .urlPos ],
107
107
config .URLs [i .urlPos ],
You can’t perform that action at this time.
0 commit comments