-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathtable.go
49 lines (40 loc) · 923 Bytes
/
table.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
// Copyright 2017 The go-sqlite Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package sqlite3
import (
"reflect"
)
// Table is a SQLite table
type Table struct {
name string
pageid int
cols []Column
}
// Name returns the name of the table
func (t *Table) Name() string {
return t.name
}
// NumRow returns the number of rows in the table
func (t *Table) NumRow() int64 {
//return t.nrows
// FIXME(sbinet)
return -1
}
// Columns returns the columns of the table
func (t *Table) Columns() []Column {
return t.cols
}
// Column describes a column in a SQLite table
type Column struct {
name string
typ reflect.Type
}
// Name returns the name of the column
func (col *Column) Name() string {
return col.name
}
// Type returns the SQLite type of the column
func (col *Column) Type() reflect.Type {
return col.typ
}