2019-01-08 19:53:04 -05:00
|
|
|
/*
|
2019-04-09 14:39:42 -04:00
|
|
|
* MinIO Cloud Storage, (C) 2019 MinIO, Inc.
|
2019-01-08 19:53:04 -05:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package sql
|
|
|
|
|
2019-08-31 03:07:40 -04:00
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
|
|
|
"github.com/bcicen/jstream"
|
|
|
|
)
|
2019-03-09 11:13:37 -05:00
|
|
|
|
|
|
|
// SelectObjectFormat specifies the format of the underlying data
|
|
|
|
type SelectObjectFormat int
|
|
|
|
|
|
|
|
const (
|
|
|
|
// SelectFmtUnknown - unknown format (default value)
|
|
|
|
SelectFmtUnknown SelectObjectFormat = iota
|
|
|
|
// SelectFmtCSV - CSV format
|
|
|
|
SelectFmtCSV
|
|
|
|
// SelectFmtJSON - JSON format
|
|
|
|
SelectFmtJSON
|
|
|
|
// SelectFmtParquet - Parquet format
|
|
|
|
SelectFmtParquet
|
|
|
|
)
|
|
|
|
|
2019-01-08 19:53:04 -05:00
|
|
|
// Record - is a type containing columns and their values.
|
|
|
|
type Record interface {
|
|
|
|
Get(name string) (*Value, error)
|
|
|
|
Set(name string, value *Value) error
|
2019-08-31 03:07:40 -04:00
|
|
|
WriteCSV(writer io.Writer, fieldDelimiter rune) error
|
|
|
|
WriteJSON(writer io.Writer) error
|
2019-03-09 11:13:37 -05:00
|
|
|
|
2019-09-27 15:33:14 -04:00
|
|
|
// Clone the record and if possible use the destination provided.
|
|
|
|
Clone(dst Record) Record
|
2019-09-16 20:26:27 -04:00
|
|
|
Reset()
|
|
|
|
|
2019-03-09 11:13:37 -05:00
|
|
|
// Returns underlying representation
|
|
|
|
Raw() (SelectObjectFormat, interface{})
|
|
|
|
|
|
|
|
// Replaces the underlying data
|
|
|
|
Replace(k jstream.KVS) error
|
2019-01-08 19:53:04 -05:00
|
|
|
}
|