Skip to content

Commit 2e978fc

Browse files
authored
Deps: remove SQLite (#564)
This blocks upgrading to ActiveRecord 6.x, as the query for `true`/`false` values is different for some reason depending on the database, and it fails tests with SQLite. The simplest solution in this case is probably to remove SQLite. The production setup uses Postgres, so better to have a consistent database setup, anyway. This also frees us up to take advantage of Postgres specific features.
1 parent 9ef2dc0 commit 2e978fc

File tree

9 files changed

+10
-25
lines changed

9 files changed

+10
-25
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ _yardoc
2020
doc/
2121
bin/
2222

23-
db/*.sqlite
2423
.DS_Store
2524
.localeapp

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ before_install:
22
- gem update bundler
33
- 'echo "RUBY_VERSION: $RUBY_VERSION"'
44
before_script:
5+
- bundle exec rake db:create db:schema:load
56
- npm install -g mocha-phantomjs@4.1.0
67
- bundle exec rake test_js &> /dev/null &
78
- sleep 5
@@ -10,6 +11,8 @@ language: ruby
1011
rvm:
1112
- 2.7.2
1213
- ruby-head
14+
services:
15+
- postgresql
1316
matrix:
1417
allow_failures:
1518
- rvm: ruby-head

Gemfile

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ group :development do
1212
gem "rubocop-rails", require: false
1313
gem "rubocop-rake", require: false
1414
gem "rubocop-rspec", require: false
15-
gem "sqlite3"
1615
end
1716

1817
group :development, :test do

Gemfile.lock

-2
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ GEM
179179
rack (> 1, < 3)
180180
sprockets-helpers (1.4.0)
181181
sprockets (>= 2.2)
182-
sqlite3 (1.4.2)
183182
sync (0.5.0)
184183
term-ansicolor (1.7.1)
185184
tins (~> 1.0)
@@ -241,7 +240,6 @@ DEPENDENCIES
241240
sinatra-flash
242241
sprockets
243242
sprockets-helpers
244-
sqlite3
245243
thread
246244
timecop
247245
uglifier

config/database.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ development:
55
pool: 5
66

77
test:
8-
adapter: sqlite3
9-
database: db/stringer_test.sqlite
8+
adapter: postgresql
9+
database: stringer_test
10+
encoding: unicode
11+
pool: 5
1012

1113
production:
1214
url: <%= ENV["DATABASE_URL"] %>

db/stringer_test.sqlite

17 KB
Binary file not shown.

docker/start.sh

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
if [ -z "$DATABASE_URL" ]; then
33
cat <<-EOF
44
$(tput setaf 1)Error: no DATABASE_URL was specified.
5-
6-
For a quick start use DATABASE_URL="sqlite3:':memory:'"
7-
(not recommended for production).
85
EOF
96

107
exit 1

docs/VPS.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ The first step is installing some essential dependencies from your VPS's package
55

66
#### Ubuntu/Debian
77

8-
sudo apt-get install git libxml2-dev libxslt-dev libcurl4-openssl-dev libpq-dev libsqlite3-dev build-essential postgresql libreadline-dev
8+
sudo apt-get install git libxml2-dev libxslt-dev libcurl4-openssl-dev libpq-dev build-essential postgresql libreadline-dev
99

1010
#### CentOS/Fedora
1111

12-
sudo yum install git libxml2-devel libxslt-devel curl-devel postgresql-devel sqlite-devel make automake gcc gcc-c++ postgresql-server readline-devel openssl-devel
12+
sudo yum install git libxml2-devel libxslt-devel curl-devel postgresql-devel make automake gcc gcc-c++ postgresql-server readline-devel openssl-devel
1313

1414
On CentOS after installing Postgres, I needed to run these commands, Fedora likely the same.
1515

1616
service postgresql initdb && service postgresql start
1717

1818
#### Arch Linux
1919

20-
pacman -S git postgresql base-devel libxml2 libxslt curl sqlite readline postgresql-libs
20+
pacman -S git postgresql base-devel libxml2 libxslt curl readline postgresql-libs
2121

2222
Here are some Arch specific instructions for setting up postgres
2323

docs/docker.md

-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
# Stringer on Docker
22

3-
## Quick test setup
4-
5-
To quickly try out Stringer on your local machine run the following one liner:
6-
7-
```sh
8-
docker run --rm -it -e DATABASE_URL="sqlite3:':memory:'" -p 8080:8080 mdswanson/stringer
9-
```
10-
11-
Visit `http://localhost:8080` and enjoy Stringer!
12-
13-
**One caveat**: Stringer was not designed to be used with sqlite so you might run into some issues if you
14-
have Stringer fetch many feeds. See [this issue](https://github.com/swanson/stringer/issues/164) for details.
15-
163
## Production ready setup using docker-compose
174

185
Download [docker-compose.yml](../docker-compose.yml) and in the corresponding foler, run `docker-compose up -d`, give it a second and visit `localhost`

0 commit comments

Comments
 (0)