transform

package
v0.0.0-...-df2f5af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package transform includes these cast functions to allow the project to accomplish two things:

  • convert strings from the CSV files to other formats (e.g. int, float32, time.Time);
  • differentiate empty values (such as 0 for int) from missing values.

This is achieved using pointers, so we have nil as a marker for missing value.

Since our use case involves serving this data in JSON format, this is crucial so we can use `null` when there is no value, and "0" when the value of an integer, for example, is 0.

Index

Constants

View Source
const (
	// MaxParallelDBQueries is the default for maximum number of parallels save
	// queries sent to the database
	MaxParallelDBQueries = 8

	// BatchSize determines the size of the batches used to create the initial JSON
	// data in the database.
	BatchSize = 8192
)
View Source
const NationalTreasureFileName = "TABMUN.CSV"

NationalTreasureFileName is the name of the CSV containing city names and their codes.

Variables

This section is empty.

Functions

func Transform

func Transform(dir string, db database, max, s int, p, s1 bool, s2 string) error

Transform the downloaded files for company venues creating a database record per CNPJ

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL