Brew Sqlite



Sqlite installed by Homebrew is keg-only, which is not linked to /usr/local/. This is because system already have older version of sqlite3. If you really want to invoke Homebrew's sqlite binary, specify full path as below. $ /usr/local/opt/sqlite/bin/sqlite3 (All Homebrew package is.

  • DB Browser for SQLite; Homebrew. If you prefer using Homebrew for macOS, our latest release can be installed via Homebrew Cask: brew install -cask db-browser-for-sqlite Nightly builds. Download nightly builds for Windows and macOS here: Linux. DB Browser for SQLite works well on Linux.
  • Install command: brew install sqlite. Also known as: sqlite3. Command-line interface for SQLite. License: blessing. /api/formula/sqlite.json (JSON API).
Rebuilding node-sqlite3 with support for statically linked SQLCipher
custom-node-sqlite3-binding.gyp
# This is a modified version of binding.gyp (from node-sqlite3) that allows
# SQLCipher to be *statically linked* for Electron distribution to machines that
# do not have SQLCipher development headers present. If you distribute
# node-sqlite3 with dynamically linked SQLite/SQLCipher bindings (the default),
# your app will error out at runtime on user's machines that do not have
# SQLCipher.
#
# This problem is tricky to test and catch because the app will work fine on
# your machine, because you've probably installed SQLCipher to custom-build
# node-sqlite3. To test that everything is working, package your Electron app,
# uninstall SQLCipher (i.e. `brew uninstall sqlcipher`), then run your app.
#
# This was very finnicky and tricky to get right. The final source of truth was
# this GitHub comment:
# https://github.com/fritx/win-sqlcipher/issues/2#issuecomment-326524839
#
# I run a script as part of my package.json `postinstall` script that replaces
# ~/node_modules/sqlite3/binding.gyp with this version of binding.gyp, then I
# run the appropriate `npm rebuild` command for my OS and Electron version.
#
# You will not need the compiler/linker flags (`export LDFLAGS='-L`brew --prefix`/opt/sqlcipher/lib'` and `export CPPFLAGS='-I`brew --prefix`/opt/sqlcipher/include'`) but you will need to additionally link the crypto library.
# Example command:
# export LDFLAGS='-lcrypto'
# npm rebuild sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=`brew --prefix` --runtime=electron --target=2.0.11 --dist-url=https://atom.io/download/electron`
{
'includes': [ 'deps/common-sqlite.gypi' ],
'variables': {
'sqlite%':'internal',
'sqlite_libname%':'sqlite3'
},
'targets': [
{
'target_name': '<(module_name)',
'include_dirs': ['<!(node -e 'require('nan')')'],
'conditions': [
['sqlite != 'internal', {
'include_dirs': [ '/usr/local/opt/sqlcipher/include/sqlcipher' ],
'libraries': [
'/usr/local/opt/sqlcipher/lib/libsqlcipher.a'
],
'conditions': [ [ 'OS'linux', {'libraries+':['-Wl,-rpath=<@(sqlite)/lib/libsqlcipher.a']} ] ],
'conditions': [ [ 'OS!='win', {'libraries+':['-L<@(sqlite)/lib/libsqlcipher.a']} ] ],
'msvs_settings': {
'VCLinkerTool': {
'AdditionalLibraryDirectories': [
'<(sqlite)/lib'
],
},
}
},
{
'dependencies': [
'deps/sqlite3.gyp:sqlite3'
]
}
]
],
'sources': [
'src/database.cc',
'src/node_sqlite3.cc',
'src/statement.cc'
]
},
{
'target_name': 'action_after_build',
'type': 'none',
'dependencies': [ '<(module_name)' ],
'copies': [
{
'files': [ '<(PRODUCT_DIR)/<(module_name).node' ],
'destination': '<(module_path)'
}
]
}
]
}
package.json

Brew Update Sqlite3

Brew
{
'name': 'example',
'scripts': {
'postinstall': 'yarn flow-typed && yarn build-dll && yarn limited-electron-rebuild && yarn rebuild-sqlite',
'limited-electron-rebuild': 'electron-rebuild --only @sentry/electron,sequelize',
'rebuild-sqlite': 'yarn install-sqlcipher && yarn copy-custom-node-sqlite3-binding && yarn npm-rebuild-sqlite',
'install-sqlcipher': 'brew install sqlcipher --with-fts',
'copy-custom-node-sqlite3-binding': 'cp ./internals/scripts/custom-node-sqlite3-binding.gyp ./node_modules/sqlite3/binding.gyp',
'npm-rebuild-sqlite': 'LDFLAGS='-lcrypto' npm rebuild sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=`brew --prefix` --runtime=electron --target=2.0.11 --dist-url=https://atom.io/download/electron &>/dev/null',
},
'build': {
'npmRebuild': false//Wehandlerebuildinginlimited-electron-rebuildandrebuild-sqlcipher
}
}
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

About the App

  • App name: sqlite
  • App description: Command-line interface for SQLite
  • App website: https://sqlite.org/

Install the App

  1. Press Command+Space and type Terminal and press enter/return key.
  2. Run in Terminal app:
    ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)' < /dev/null 2> /dev/null
    and press enter/return key.
    If the screen prompts you to enter a password, please enter your Mac's user password to continue. When you type the password, it won't be displayed on screen, but the system would accept it. So just type your password and press ENTER/RETURN key. Then wait for the command to finish.
  3. Run:
    brew install sqlite

Brew Install Sqlite3 Version

Done! You can now use sqlite.

Brew Sqlite Dev

Similar Software for Mac