fuelingtheweb's avatar

CircleCI SQLite3 with JSON

For my PHPUnit tests, I'm using an in memory sqlite database, and I have some JSON columns that I'm testing. I updated SQLite3 locally pretty painlessly to enable JSON support, but when my tests run on CircleCI, I keep getting this error:

PDOException: SQLSTATE[HY000]: General error: 1 no such function: json_extract

So, I'm thinking JSON is not enabled in SQLite3 when CircleCI runs, but I can't figure out how to enable it. Any help would be greatly appreciated.

Below is my CircleCI configuration:

# PHP CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-php/ for more details
#
version: 2
jobs:
    build:
        docker:
            - image: circleci/php:7.2.9-fpm-stretch
        working_directory: ~/laravel
        steps:
            - checkout

            - run:
                name: Install PHP sqlite and libpng
                command: sudo apt-get update && sudo apt-get install -y libpng-dev libsqlite3-dev

            - run:
                name: Install PHP Extensions
                command: sudo docker-php-ext-install gd

            - run:
                name: Setup Laravel environment variables for CircleCI test
                command: cp .env.example .env

            - run:
                name: Update composer to latest version
                command: composer self-update

            - restore_cache:
                keys:
                    - composer-v1-{{ checksum "composer.json" }}
                    - composer-v1-
            - run: composer install -n --prefer-dist
            - save_cache:
                key: composer-v1-{{ checksum "composer.json" }}
                paths:
                    - vendor

            - run:
                name: Generate key
                command: php artisan key:generate

            - run:
                name: Run PHPUnit
                command: vendor/bin/phpunit
0 likes
2 replies

Please or to participate in this conversation.