This repository has been archived by the owner. It is now read-only.

Use homebrew's sqlite #702

Closed
jasonlfunk opened this Issue Aug 23, 2013 · 11 comments

Comments

Projects
None yet
5 participants
@jasonlfunk
Copy link

jasonlfunk commented Aug 23, 2013

It looks to me that there isn't an option to link with homebrew's version of sqlite. The stock OS X one is really old and I require some of the newer features. Could this be implemented?

@lucasmichot

This comment has been minimized.

Copy link
Contributor

lucasmichot commented Aug 23, 2013

This isssue should not be related to homebrew-php.

There is a formula in main Homebrew repository (version 3.7.17): https://github.com/mxcl/homebrew/blob/master/Library/Formula/sqlite.rb

Install it:
brew update && brew install sqlite

Then to make sure you are using Homebrew SQLite and not OS X SQLite, you can add the following line to your bash profile:
export PATH="$(brew --prefix sqlite)/bin:$PATH"

@josegonzalez

This comment has been minimized.

Copy link
Contributor

josegonzalez commented Aug 23, 2013

Actually, this seems legit. Are we allowing a depends_on the homebrew formula? If not, then the formula will be built against stock, even if you've installed the homebrew version.

Re-opening as a valid feature request :)

@josegonzalez josegonzalez reopened this Aug 23, 2013

@ablyler

This comment has been minimized.

Copy link
Contributor

ablyler commented Aug 23, 2013

@jasonlfunk: What version of PHP are you using? Are you using the sqlite (only comes stock in 5.3) or sqlite3 (stock in 5.3 - 5.5) extension? The sqlite3 is completely standalone, sqlite however does dynamically link against the sqlite library.

@josegonzalez: I'm guessing we'd want to make this type of change in the PHP 5.3 formula only, since PHP 5.4 and 5.5 don't link against sqlite at all?

@jasonlfunk

This comment has been minimized.

Copy link

jasonlfunk commented Aug 24, 2013

@ablyler I am using 5.4. It's possible that I had some misunderstanding about what is possible. I was attempting to use named memory databases (http://www.sqlite.org/inmemorydb.html) with PHP but they are only available in sqlite 3.3.13. OS X ships with 3.3.12. It's possible that even with the newest version of sqlite, this still might not work with PHP.

@ablyler

This comment has been minimized.

Copy link
Contributor

ablyler commented Aug 24, 2013

@jasonlfunk Does this example of using SQLite3 w/ named memory databases work for you: https://gist.github.com/6328383? It worked for me using PHP 5.5: https://gist.github.com/6328393. If it doesn't work, I can get PHP 5.4 on my box to help debug it.

@ablyler

This comment has been minimized.

Copy link
Contributor

ablyler commented Aug 24, 2013

It actually look like that example created a file on disk... Now that I've reproduced it (in both PHP 5.4 and 5.5), I'll look into it some more.

@jasonlfunk

This comment has been minimized.

Copy link

jasonlfunk commented Aug 24, 2013

Yep, that's what I am seeing in 5.4 as well.

@ablyler

This comment has been minimized.

Copy link
Contributor

ablyler commented Aug 24, 2013

Looks like this is a bug / missing feature w/ PHP. I went ahead and tried this on a Gentoo box w/ PHP 5.4 and 5.5 and both had the same issue. I also dug in and found that PHP bundles SQLite as part of their source code: https://github.com/php/php-src/tree/php-5.5.3/ext/sqlite3/libsqlite. I'd recommend opening a bug w/ them about this at: https://bugs.php.net. Feel free to share my sample script.

@jasonlfunk

This comment has been minimized.

Copy link

jasonlfunk commented Aug 24, 2013

Yeah. I think you are right. There is already a bug filed to upgrade the internal version of SQLite: https://bugs.php.net/bug.php?id=64475.

I'll close this as it's not homebrew's fault.

@jasonlfunk jasonlfunk closed this Aug 24, 2013

@kosiokarchev

This comment has been minimized.

Copy link

kosiokarchev commented Aug 19, 2017

Three years later, I am stumbling at this with the following problem:
the SQLite implementation included in php72 doesn't include the ICU extension, while homebrew's sqlite3 has this as an option. Therefore, I think there is still some point in allowing linking with custom sqlite3

@josegonzalez

This comment has been minimized.

Copy link
Contributor

josegonzalez commented Aug 19, 2017

@kosiokarchev please avoid commenting on a three year old issue, and instead open up a new one describing the details of your problem. Thanks!

@Homebrew Homebrew locked and limited conversation to collaborators Aug 19, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.