Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRAGMA settings nowhere to be found #1119

Open
RafaelZasas opened this issue Mar 1, 2024 · 0 comments
Open

PRAGMA settings nowhere to be found #1119

RafaelZasas opened this issue Mar 1, 2024 · 0 comments

Comments

@RafaelZasas
Copy link
Contributor

I have an existing init.sql file that I use locally when running with the go SDK.

I start the program by running pragma commands:

func (db *db) Bootstrap() error {

	// Keeping this as a private function to avoid fuck ups
	if err := db.runMigrations(); err != nil {
		return fmt.Errorf("database.New: %q\n", err)
	}

	// Set default pragma settings
	_, err := db.Exec(
		`
            PRAGMA busy_timeout       = 10000;
            PRAGMA journal_mode       = WAL;
            PRAGMA journal_size_limit = 200000000;
            PRAGMA synchronous        = NORMAL;
            PRAGMA foreign_keys       = ON;
            PRAGMA temp_store         = MEMORY;
            PRAGMA cache_size         = -16000;`,
	)
	if err != nil {
		return fmt.Errorf("db.Exec: %v", err)
	}

	return nil
}

In development, when running with the Mattn driver and my local sqlite3 .db file everything works fine.

But when I try to use the libsql driver in production I get errors that say unsupported statement.

If PRAGMA settings are not the same for sqlite3 and libsql, where can I find this information?

Are there some PRAGMA settings that are available in libsql and some that are not?
If so, I would like to know which are available and which are not.

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

No branches or pull requests

1 participant