sql

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

README

sqlite

Delete this folder if you don't need it. Or remember to hook it up if you're using it.

Note that you have to use cgo to build with this sqlite setup. If you're going to cross compile it might get a bit difficult. This is an example which should work when setting

GOOS=linux \
GOARCH=arm \
CGO_ENABLED=1 \
CC=arm-linux-gnueabihf-gcc \
CXX=arm-linux-gnueabihf-g++ \

FROM golang:1.22 as build

ARG app_name

# Needed for cross compiling for arm.
RUN apt-get update && apt-get install -y \
  gcc-arm-linux-gnueabihf \
  g++-arm-linux-gnueabihf

RUN go install github.com/go-task/task/v3/cmd/task@latest

WORKDIR /app

COPY Taskfile.yaml .
COPY config.env* .

COPY go.mod .
COPY go.sum .
RUN go mod download

COPY cmd/${app_name}/main.go cmd/${app_name}/main.go
COPY internal/ internal/

RUN task go:test
RUN task go:build

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DBConnectionString string `envconfig:"DB_CONNECTION_STRING" required:"true"`
}

type SQLite

type SQLite struct {
	// contains filtered or unexported fields
}

func NewSqlite

func NewSqlite(ctx context.Context, conf Config) (*SQLite, error)

func (*SQLite) Close

func (s *SQLite) Close()

func (*SQLite) Queries

func (s *SQLite) Queries() *gen.Queries

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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