Skip to content

Commit 5ba8cc7

Browse files
committed
Add golang api docs
1 parent e8741d0 commit 5ba8cc7

File tree

2 files changed

+194
-0
lines changed

2 files changed

+194
-0
lines changed

chdb.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<!-- Code generated by gomarkdoc. DO NOT EDIT -->
2+
3+
# chdb
4+
5+
```go
6+
import "github.com/chdb-io/chdb-go/chdb"
7+
```
8+
9+
## Index
10+
11+
- [func Query\(queryStr string, outputFormats ...string\) \*chdbstable.LocalResult](<#Query>)
12+
- [type Session](<#Session>)
13+
- [func NewSession\(paths ...string\) \(\*Session, error\)](<#NewSession>)
14+
- [func \(s \*Session\) Cleanup\(\)](<#Session.Cleanup>)
15+
- [func \(s \*Session\) Close\(\)](<#Session.Close>)
16+
- [func \(s \*Session\) IsTemp\(\) bool](<#Session.IsTemp>)
17+
- [func \(s \*Session\) Path\(\) string](<#Session.Path>)
18+
- [func \(s \*Session\) Query\(queryStr string, outputFormats ...string\) \*chdbstable.LocalResult](<#Session.Query>)
19+
20+
21+
<a name="Query"></a>
22+
## func [Query](<https://github.com/chdb-io/chdb-go/blob/main/chdb/wrapper.go#L8>)
23+
24+
```go
25+
func Query(queryStr string, outputFormats ...string) *chdbstable.LocalResult
26+
```
27+
28+
Query calls queryToBuffer with a default output format of "CSV" if not provided.
29+
30+
<a name="Session"></a>
31+
## type [Session](<https://github.com/chdb-io/chdb-go/blob/main/chdb/session.go#L11-L14>)
32+
33+
34+
35+
```go
36+
type Session struct {
37+
// contains filtered or unexported fields
38+
}
39+
```
40+
41+
<a name="NewSession"></a>
42+
### func [NewSession](<https://github.com/chdb-io/chdb-go/blob/main/chdb/session.go#L19>)
43+
44+
```go
45+
func NewSession(paths ...string) (*Session, error)
46+
```
47+
48+
NewSession creates a new session with the given path. If path is empty, a temporary directory is created. Note: The temporary directory is removed when Close is called.
49+
50+
<a name="Session.Cleanup"></a>
51+
### func \(\*Session\) [Cleanup](<https://github.com/chdb-io/chdb-go/blob/main/chdb/session.go#L57>)
52+
53+
```go
54+
func (s *Session) Cleanup()
55+
```
56+
57+
Cleanup closes the session and removes the directory.
58+
59+
<a name="Session.Close"></a>
60+
### func \(\*Session\) [Close](<https://github.com/chdb-io/chdb-go/blob/main/chdb/session.go#L49>)
61+
62+
```go
63+
func (s *Session) Close()
64+
```
65+
66+
Close closes the session and removes the temporary directory
67+
68+
```
69+
temporary directory is created when NewSession was called with an empty path.
70+
```
71+
72+
<a name="Session.IsTemp"></a>
73+
### func \(\*Session\) [IsTemp](<https://github.com/chdb-io/chdb-go/blob/main/chdb/session.go#L68>)
74+
75+
```go
76+
func (s *Session) IsTemp() bool
77+
```
78+
79+
IsTemp returns whether the session is temporary.
80+
81+
<a name="Session.Path"></a>
82+
### func \(\*Session\) [Path](<https://github.com/chdb-io/chdb-go/blob/main/chdb/session.go#L63>)
83+
84+
```go
85+
func (s *Session) Path() string
86+
```
87+
88+
Path returns the path of the session.
89+
90+
<a name="Session.Query"></a>
91+
### func \(\*Session\) [Query](<https://github.com/chdb-io/chdb-go/blob/main/chdb/session.go#L39>)
92+
93+
```go
94+
func (s *Session) Query(queryStr string, outputFormats ...string) *chdbstable.LocalResult
95+
```
96+
97+
Query calls queryToBuffer with a default output format of "CSV" if not provided.
98+
99+
Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)

lowApi.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<!-- Code generated by gomarkdoc. DO NOT EDIT -->
2+
3+
# chdbstable
4+
5+
```go
6+
import "github.com/chdb-io/chdb-go/chdbstable"
7+
```
8+
9+
## Index
10+
11+
- [type LocalResult](<#LocalResult>)
12+
- [func QueryStable\(argc int, argv \[\]string\) \*LocalResult](<#QueryStable>)
13+
- [func \(r \*LocalResult\) Buf\(\) \[\]byte](<#LocalResult.Buf>)
14+
- [func \(r \*LocalResult\) BytesRead\(\) uint64](<#LocalResult.BytesRead>)
15+
- [func \(r \*LocalResult\) Elapsed\(\) float64](<#LocalResult.Elapsed>)
16+
- [func \(r \*LocalResult\) Len\(\) int](<#LocalResult.Len>)
17+
- [func \(r \*LocalResult\) RowsRead\(\) uint64](<#LocalResult.RowsRead>)
18+
- [func \(r LocalResult\) String\(\) string](<#LocalResult.String>)
19+
20+
21+
<a name="LocalResult"></a>
22+
## type [LocalResult](<https://github.com/chdb-io/chdb-go/blob/main/chdbstable/chdb.go#L15-L17>)
23+
24+
LocalResult mirrors the C struct local\_result in Go.
25+
26+
```go
27+
type LocalResult struct {
28+
// contains filtered or unexported fields
29+
}
30+
```
31+
32+
<a name="QueryStable"></a>
33+
### func [QueryStable](<https://github.com/chdb-io/chdb-go/blob/main/chdbstable/chdb.go#L32>)
34+
35+
```go
36+
func QueryStable(argc int, argv []string) *LocalResult
37+
```
38+
39+
QueryStable calls the C function query\_stable.
40+
41+
<a name="LocalResult.Buf"></a>
42+
### func \(\*LocalResult\) [Buf](<https://github.com/chdb-io/chdb-go/blob/main/chdbstable/chdb.go#L44>)
43+
44+
```go
45+
func (r *LocalResult) Buf() []byte
46+
```
47+
48+
Accessor methods to access fields of the local\_result struct.
49+
50+
<a name="LocalResult.BytesRead"></a>
51+
### func \(\*LocalResult\) [BytesRead](<https://github.com/chdb-io/chdb-go/blob/main/chdbstable/chdb.go#L84>)
52+
53+
```go
54+
func (r *LocalResult) BytesRead() uint64
55+
```
56+
57+
58+
59+
<a name="LocalResult.Elapsed"></a>
60+
### func \(\*LocalResult\) [Elapsed](<https://github.com/chdb-io/chdb-go/blob/main/chdbstable/chdb.go#L70>)
61+
62+
```go
63+
func (r *LocalResult) Elapsed() float64
64+
```
65+
66+
67+
68+
<a name="LocalResult.Len"></a>
69+
### func \(\*LocalResult\) [Len](<https://github.com/chdb-io/chdb-go/blob/main/chdbstable/chdb.go#L63>)
70+
71+
```go
72+
func (r *LocalResult) Len() int
73+
```
74+
75+
76+
77+
<a name="LocalResult.RowsRead"></a>
78+
### func \(\*LocalResult\) [RowsRead](<https://github.com/chdb-io/chdb-go/blob/main/chdbstable/chdb.go#L77>)
79+
80+
```go
81+
func (r *LocalResult) RowsRead() uint64
82+
```
83+
84+
85+
86+
<a name="LocalResult.String"></a>
87+
### func \(LocalResult\) [String](<https://github.com/chdb-io/chdb-go/blob/main/chdbstable/chdb.go#L55>)
88+
89+
```go
90+
func (r LocalResult) String() string
91+
```
92+
93+
Stringer interface for LocalResult
94+
95+
Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)

0 commit comments

Comments
 (0)