Documentation
¶
Overview ¶
Package importer exposes stable data import helpers backed by tinySQL's internal importer implementation.
Index ¶
- func OpenFile(ctx context.Context, filePath string, opts *ImportOptions) (*tinysql.DB, string, error)
- type FuzzyImportOptions
- type ImportOptions
- type ImportResult
- func FuzzyImportCSV(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, ...) (*ImportResult, error)
- func FuzzyImportJSON(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, ...) (*ImportResult, error)
- func ImportCSV(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, ...) (*ImportResult, error)
- func ImportFile(ctx context.Context, db *tinysql.DB, tenant, tableName, filePath string, ...) (*ImportResult, error)
- func ImportGeoJSON(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, ...) (*ImportResult, error)
- func ImportJSON(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, ...) (*ImportResult, error)
- func ImportKML(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, ...) (*ImportResult, error)
- func ImportShapefile(ctx context.Context, db *tinysql.DB, tenant, tableName, filePath string, ...) (*ImportResult, error)
- func ImportXML(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, ...) (*ImportResult, error)
- func ImportYAML(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, ...) (*ImportResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FuzzyImportOptions ¶
type FuzzyImportOptions = ii.FuzzyImportOptions
FuzzyImportOptions extends ImportOptions with tolerant parsing behavior.
type ImportOptions ¶
type ImportOptions = ii.ImportOptions
ImportOptions controls structured data imports.
type ImportResult ¶
type ImportResult = ii.ImportResult
ImportResult contains metadata about an import operation.
func FuzzyImportCSV ¶
func FuzzyImportCSV(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, opts *FuzzyImportOptions) (*ImportResult, error)
FuzzyImportCSV imports malformed CSV-like data using tolerant parsing.
func FuzzyImportJSON ¶
func FuzzyImportJSON(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, opts *FuzzyImportOptions) (*ImportResult, error)
FuzzyImportJSON imports malformed JSON-like data using tolerant parsing.
func ImportCSV ¶
func ImportCSV(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, opts *ImportOptions) (*ImportResult, error)
ImportCSV imports CSV or TSV-like data from src.
func ImportFile ¶
func ImportFile(ctx context.Context, db *tinysql.DB, tenant, tableName, filePath string, opts *ImportOptions) (*ImportResult, error)
ImportFile detects a file format and imports it into a table.
func ImportGeoJSON ¶
func ImportGeoJSON(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, opts *ImportOptions) (*ImportResult, error)
ImportGeoJSON imports GeoJSON feature data from src.
func ImportJSON ¶
func ImportJSON(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, opts *ImportOptions) (*ImportResult, error)
ImportJSON imports JSON or NDJSON-like data from src.
func ImportKML ¶
func ImportKML(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, opts *ImportOptions) (*ImportResult, error)
ImportKML imports KML placemark data from src.
func ImportShapefile ¶
func ImportShapefile(ctx context.Context, db *tinysql.DB, tenant, tableName, filePath string, opts *ImportOptions) (*ImportResult, error)
ImportShapefile imports an ESRI Shapefile path into a table.
func ImportXML ¶
func ImportXML(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, opts *ImportOptions) (*ImportResult, error)
ImportXML imports row-oriented XML from src.
func ImportYAML ¶
func ImportYAML(ctx context.Context, db *tinysql.DB, tenant, tableName string, src io.Reader, opts *ImportOptions) (*ImportResult, error)
ImportYAML imports a YAML mapping or sequence of mappings from src.