Skip to content

Allow passing sqlite CFLAGS via a extconf.rb argument that is configurable by bundler #401

@flavorjones

Description

@flavorjones

See #400 for the discussion that ended with this feature request.

The user in this case is someone who is a sqlite professional™ and wants to set some compile-time flags for default pragma values. See https://fractaledmind.github.io/2023/09/07/enhancing-rails-sqlite-fine-tuning/ for an example use case.

Currently the only way to do this is to set a CFLAGS environment variable at gem installation time (and, separately, to ensure that you download and compile the source gem, not a precompiled gem).

It would be helpful if options were all contained within the bundler/gemfile toolchain, so that these two changes would be sufficient:

# Gemfile
gem "sqlite3", force_ruby_platform: true # needs bundler 2.3.18 or higher

And a bundler config:

bundle config build.sqlite3 --sqlite-cflags="-DSQLITE_DEFAULT_PAGE_SIZE=16300"

(or the equivalent entry in .bundler/config:

BUNDLE_BUILD__SQLITE3: "--sqlite-cflags=-DSQLITE_DEFAULT_PAGE_SIZE=16300"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions