Skip to content

Conversation

@fraenky8
Copy link
Owner

@fraenky8 fraenky8 commented Oct 2, 2019

In order to fix #22 we need to introduce a new driver (https://github.com/mattn/go-sqlite3). It states in its compilation section that it requires CGO_ENABLED=1 and a working gcc compiler on the target system. This restricts usage of this tool and forces users to provide the correct environment to build it. Therefore I decided to exclude SQLite3 by default and provide a handy way to enable user to build it via a Makefile. The assumption is that user who have the neccessary environment set up are also able to execute a Makefile.

Furthermore with a growing number of dependencies and with the latest go1.13 release I want to introduce vendoring and versioning via go modules.

This said, this PR does hereby the following:

  • Adds a new database type sqlite3 and an implementation for it.
  • Introduces a Makefile for a convenient way to enable the new database type for these who need it.
  • Introduced the build flag sqlite3 which when set builds the new file sqlite_driver.go.
  • Updates and adds unit tests.
  • Provides some minor refactoring and changes.
  • Adds go modules.
  • Adds the vendor folder.
  • Updates the README.

@fraenky8 fraenky8 self-assigned this Oct 2, 2019
@fraenky8 fraenky8 mentioned this pull request Oct 2, 2019
Because it can easily obtained by the Database itself.
SQLite3 will be disabled nby default. It can be built/enabled via
built-tag `sqlite3`. The Makefile exists for convenience. If the new
type is used tables-to-go will fail with the message driver not found.
Therefore the separate sqlite_driver.go file is introduced.

Moved the default username from Settings to Postgres implementation.

Created unit tests for DSN methods of Postgres and SQLite.
Updated make file to include vendor'ed build.
@fraenky8 fraenky8 merged commit 0b14c60 into master Nov 18, 2019
@fraenky8 fraenky8 deleted the ISSUE-22 branch November 18, 2019 15:17
chingsungho pushed a commit to chingsungho/tables-to-go that referenced this pull request Mar 8, 2025
ISSUE-22: Add support for sqlite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

can you support sqlite?

2 participants