Documentation
¶
Index ¶
- type Config
- type PostgresDB
- func (p *PostgresDB) Close() error
- func (p *PostgresDB) GetAllCSVData() ([]map[string]interface{}, error)
- func (p *PostgresDB) GetCSVDataByID(id int) (map[string]interface{}, error)
- func (p *PostgresDB) InitSchema() error
- func (p *PostgresDB) InsertCSVData(filename string, records []map[string]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Host string
Port string
User string
Password string
DBName string
SSLMode string
}
Config holds database configuration
type PostgresDB ¶
func NewPostgresDB ¶
func NewPostgresDB(config Config) (*PostgresDB, error)
NewPostgresDB creates a new PostgreSQL database connection
func (*PostgresDB) GetAllCSVData ¶
func (p *PostgresDB) GetAllCSVData() ([]map[string]interface{}, error)
GetAllCSVData retrieves all CSV data from the database
func (*PostgresDB) GetCSVDataByID ¶
func (p *PostgresDB) GetCSVDataByID(id int) (map[string]interface{}, error)
GetCSVDataByID retrieves CSV data by ID
func (*PostgresDB) InitSchema ¶
func (p *PostgresDB) InitSchema() error
InitSchema creates the necessary tables if they don't exist
func (*PostgresDB) InsertCSVData ¶
func (p *PostgresDB) InsertCSVData(filename string, records []map[string]string) error
InsertCSVData inserts CSV data (as JSON) into the database
Click to show internal directories.
Click to hide internal directories.