docs: whitespace fix
This commit is contained in:
@@ -4,7 +4,7 @@ Package `gocqlx` is a Scylla / Cassandra productivity toolkit for `gocql`. It's
|
|||||||
similar to what `sqlx` is to `database/sql`.
|
similar to what `sqlx` is to `database/sql`.
|
||||||
|
|
||||||
It contains wrappers over `gocql` types that provide convenience methods which
|
It contains wrappers over `gocql` types that provide convenience methods which
|
||||||
are useful in the development of database driven applications. Under the
|
are useful in the development of database driven applications. Under the
|
||||||
hood it uses `sqlx/reflectx` package so `sqlx` models will also work with `gocqlx`.
|
hood it uses `sqlx/reflectx` package so `sqlx` models will also work with `gocqlx`.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|||||||
2
doc.go
2
doc.go
@@ -2,6 +2,6 @@
|
|||||||
// similar to what `sqlx` is to `database/sql`.
|
// similar to what `sqlx` is to `database/sql`.
|
||||||
//
|
//
|
||||||
// It contains wrappers over gocql types that provide convenience methods which
|
// It contains wrappers over gocql types that provide convenience methods which
|
||||||
// are useful in the development of database driven applications. Under the
|
// are useful in the development of database driven applications. Under the
|
||||||
// hood it uses sqlx/reflectx package so sqlx models will also work with gocqlx.
|
// hood it uses sqlx/reflectx package so sqlx models will also work with gocqlx.
|
||||||
package gocqlx
|
package gocqlx
|
||||||
|
|||||||
@@ -58,9 +58,9 @@ func isScannable(t reflect.Type) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fieldsByName fills a values interface with fields from the passed value based
|
// fieldsByName fills a values interface with fields from the passed value based
|
||||||
// on the traversals in int. If ptrs is true, return addresses instead of values.
|
// on the traversals in int. If ptrs is true, return addresses instead of values.
|
||||||
// We write this instead of using FieldsByName to save allocations and map lookups
|
// We write this instead of using FieldsByName to save allocations and map lookups
|
||||||
// when iterating over many rows. Empty traversals will get an interface pointer.
|
// when iterating over many rows. Empty traversals will get an interface pointer.
|
||||||
// Because of the necessity of requesting ptrs or values, it's considered a bit too
|
// Because of the necessity of requesting ptrs or values, it's considered a bit too
|
||||||
// specialized for inclusion in reflectx itself.
|
// specialized for inclusion in reflectx itself.
|
||||||
func fieldsByTraversal(v reflect.Value, traversals [][]int, values []interface{}, ptrs bool) error {
|
func fieldsByTraversal(v reflect.Value, traversals [][]int, values []interface{}, ptrs bool) error {
|
||||||
|
|||||||
10
iterx.go
10
iterx.go
@@ -50,8 +50,8 @@ func (iter *Iterx) Unsafe() *Iterx {
|
|||||||
return iter
|
return iter
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get scans first row into a destination and closes the iterator. If the
|
// Get scans first row into a destination and closes the iterator. If the
|
||||||
// destination type is a Struct, then StructScan will be used. If the
|
// destination type is a Struct, then StructScan will be used. If the
|
||||||
// destination is some other type, then the row must only have one column which
|
// destination is some other type, then the row must only have one column which
|
||||||
// can scan into that type.
|
// can scan into that type.
|
||||||
func (iter *Iterx) Get(dest interface{}) error {
|
func (iter *Iterx) Get(dest interface{}) error {
|
||||||
@@ -99,8 +99,8 @@ func (iter *Iterx) scanAny(dest interface{}, structOnly bool) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Select scans all rows into a destination, which must be a slice of any type
|
// Select scans all rows into a destination, which must be a slice of any type
|
||||||
// and closes the iterator. If the destination slice type is a Struct, then
|
// and closes the iterator. If the destination slice type is a Struct, then
|
||||||
// StructScan will be used on each row. If the destination is some other type,
|
// StructScan will be used on each row. If the destination is some other type,
|
||||||
// then each row must only have one column which can scan into that type.
|
// then each row must only have one column which can scan into that type.
|
||||||
func (iter *Iterx) Select(dest interface{}) error {
|
func (iter *Iterx) Select(dest interface{}) error {
|
||||||
if iter.query == nil {
|
if iter.query == nil {
|
||||||
@@ -182,7 +182,7 @@ func (iter *Iterx) scanAll(dest interface{}, structOnly bool) error {
|
|||||||
|
|
||||||
// StructScan is like gocql.Scan, but scans a single row into a single Struct.
|
// StructScan is like gocql.Scan, but scans a single row into a single Struct.
|
||||||
// Use this and iterate manually when the memory load of Select() might be
|
// Use this and iterate manually when the memory load of Select() might be
|
||||||
// prohibitive. StructScan caches the reflect work of matching up column
|
// prohibitive. StructScan caches the reflect work of matching up column
|
||||||
// positions to fields to avoid that overhead per scan, which means it is not
|
// positions to fields to avoid that overhead per scan, which means it is not
|
||||||
// safe to run StructScan on the same Iterx instance with different struct
|
// safe to run StructScan on the same Iterx instance with different struct
|
||||||
// types.
|
// types.
|
||||||
|
|||||||
Reference in New Issue
Block a user