gosqlite3

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

README

gosqlite3

Go Reference

gosqlite3 provides basic CRUD functionalities and a predefined users tables that contains below columns

Column name Type
Id INTEGER PRIMARY KEY AUTOINCREMENT
username TEXT NOT NULL UNIQUE
password TEXT

Getting started with gosqlite3 package [Critical step]

  1. Create "db/config" folder under parent program folder .
  2. Create "config.yml" file inside config dir .
  3. Add below config in the "config.yml" file . Please note that the file can be updated based on users requirement .
dbConfig:
  path: "./db" # Path where the db will be created and stored
  name: "mydb.db" # Name of the db

FOSSA Status

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToSQLiteDB added in v1.2.0

func ConnectToSQLiteDB(dbName, dbPath string) (*sql.DB, error)

func ReadDbConfig added in v1.2.0

func ReadDbConfig() (*sql.DB, error)

Types

type Config

type Config struct {
	DatabaseConfig Database `yaml:"dbConfig"`
}

Struct to hold the full YAML config

type Database

type Database struct {
	DbPath string `yaml:"path"`
	DbName string `yaml:"name"`
}

Global vars will be used for storing config details

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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