Skip to content

core-go/io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IO

  • Utilities to load file, save file, zip file
  • File Stream Writer
  • File Stream Reader
  • Implement ETL process for Data Processing, Business Intelligence

ETL (Extract-Transform-Load)

Extract-Transform-Load (ETL) is a data integration process involving the extraction of data from various sources, transformation into a suitable format, and loading into a target database or data warehouse.

  • Extracting data from various sources.
  • Transforming the data into a suitable format/structure.
  • Loading the transformed data into a target database or data warehouse.

Batch processing

  • core-go/io is designed for batch processing, enabling the development of complex batch applications. It supports operations such as reading, processing, and writing large volumes of data.
  • core-go/io is not an ETL tool. It provides the necessary libraries for implementing ETL processes. It allows developers to create jobs that extract data from sources, transform it, and load it into destinations, effectively supporting ETL operations.

Use Cases of core-go/io in ETL:

  • Data Migration: Moving and transforming data from legacy systems to new systems.
  • Data Processing: Handling large-scale data processing tasks like data cleansing and transformation
  • Data Warehousing: Loading and transforming data into data warehouses.
  • Business Intelligence: Transforming raw data into meaningful insights for decision-making, to provide valuable business insights and trends.

Specific Use Cases of core-go/io

Export from database to file

Export from database to file

Samples:

Import from file to database

Import from file to database

  • Detailed flow to import from file to database

    Import flow with data validation

Samples:
Layer Architecture
  • Popular for web development

Layer Architecture

Hexagonal Architecture
  • Suitable for Import Flow

Hexagonal Architecture

Based on the flow, there are 4 main components (4 main ports):
  • Reader, Validator, Transformer, Writer
Reader

Reader Adapter Sample: File Reader. We provide 2 file reader adapters:

  • Delimiter (CSV format) File Reader
  • Fix Length File Reader
Validator
  • Validator Adapter Sample: Schema Validator
  • We provide the Schema validator based on GOLANG Tags
Transformer

We provide 2 transformer adapters

  • Delimiter Transformer (CSV)
  • Fix Length Transformer
Writer

We provide many writer adapters:

Summary

File Reader

  • File Stream Reader
  • Delimiter (CSV format) File Reader
  • Fix Length File Reader

File Writer

  • File Stream Writer

Delimiter (CSV format) Transformer

  • Transform an object to Delimiter (CSV) format
  • Transform an object to Fix Length format

Appendix

Import and export data for nodejs

Export data for nodejs:

Key features
  • onecore: Standard interfaces for typescript to export data.
  • io-one: File Stream Writer, to export data to CSV or fix-length files by stream.
Libraries to receive rows as stream, to export each record one by one:
Samples
Import data for nodejs
Key features
  • onecore: Standard interfaces for typescript to export data.
  • io-one: File Stream Reader, to read CSV or fix-length files from files by stream.
  • xvalidators: Validate data
  • import-service: Implement import flow
Libraries to write data to database
  • query-core: Simple writer to insert, update, delete, insert batch for Postgres, MySQL, MS SQL
  • Oracle: oracle-core to wrap oracledb, to build insert or update SQL statement, insert batch for Oracle.
  • My SQL: mysql2-core to wrap mysql2, to build insert or update SQL statement.
  • MS SQL: mssql-core to wrap mssql, to build insert or update SQL statement.
  • SQLite: sqlite3-core to wrap sqlite3, to build insert or update SQL statement.
  • Mongo: mongodb-extension to wrap mongodb, to insert, update, upsert, insert batch, update batch, upsert batch.
Sample
  • import-sample: nodejs sample to import data from fix-length or csv file to sql (Oracle, Postgres, My SQL, MS SQL, SQLite)

Installation

Please make sure to initialize a Go module before installing core-go/io:

go get -u github.com/core-go/io

Import:

import "github.com/core-go/io"