Skip to content

Commit 96ed752

Browse files
author
Carl Sverre
authored
Update to singlestoredb-dev-image, fix devcontainer, readme improvements (#27)
* Update to singlestoredb-dev-image * fix devcontainer * readme improvements
1 parent 662ac36 commit 96ed752

File tree

6 files changed

+47
-31
lines changed

6 files changed

+47
-31
lines changed

.devcontainer/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ FROM mcr.microsoft.com/vscode/devcontainers/php:0-${VARIANT}
88
ARG NODE_VERSION="none"
99
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
1010

11+
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
12+
RUN chmod +x /usr/local/bin/install-php-extensions && \
13+
install-php-extensions gd xdebug
14+
15+
RUN install-php-extensions pdo_mysql
16+
1117
# [Optional] Uncomment this section to install additional OS packages.
1218
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1319
# && apt-get -y install --no-install-recommends <your-package-list-here>

.github/workflows/tests.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ on:
66
- main
77

88
pull_request:
9-
types: [ opened, synchronize, reopened ]
9+
types: [opened, synchronize, reopened]
1010

1111
schedule:
12-
- cron: '0 0 * * *'
12+
- cron: "0 0 * * *"
1313

1414
jobs:
1515
test:
@@ -18,9 +18,9 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
php: [ 7.3, 7.4, 8.0, 8.1 ]
22-
laravel: [ 8.*, 9.* ]
23-
dependency-version: [ prefer-lowest, prefer-stable ]
21+
php: [7.3, 7.4, 8.0, 8.1]
22+
laravel: [8.*, 9.*]
23+
dependency-version: [prefer-lowest, prefer-stable]
2424
include:
2525
- laravel: 8.*
2626
testbench: 6.*
@@ -45,14 +45,13 @@ jobs:
4545

4646
services:
4747
singlestore:
48-
# check for new versions at https://hub.docker.com/r/singlestore/cluster-in-a-box/tags
49-
image: singlestore/cluster-in-a-box:alma-7.8.6-4f052c9b50-4.0.7-1.13.8
48+
# check for new versions at https://github.com/singlestore-labs/singlestoredb-dev-image/pkgs/container/singlestoredb-dev/versions
49+
image: ghcr.io/singlestore-labs/singlestoredb-dev:0.0.8
5050
ports:
5151
- "3306:3306"
5252
env:
53-
LICENSE_KEY: ${{ secrets.SINGLESTORE_LICENSE }}
53+
SINGLESTORE_LICENSE: ${{ secrets.SINGLESTORE_LICENSE }}
5454
ROOT_PASSWORD: "test"
55-
START_AFTER_INIT: "Y"
5655

5756
steps:
5857
- name: Checkout code
@@ -80,24 +79,12 @@ jobs:
8079
- name: Execute Unit Tests
8180
run: vendor/bin/phpunit
8281

83-
- name: Wait for SingleStore to start
84-
run: |
85-
attempts=0
86-
until mysql -h 127.0.0.1 -u root -ptest -e "select 1"; do
87-
echo "waiting for mysql..."
88-
((attempts=attempts+1))
89-
if [[ $attempts -gt 5 ]]; then
90-
docker logs $(docker ps -ql)
91-
fi
92-
sleep 1
93-
done
94-
9582
- name: SingleStore Container Logs
9683
run: docker logs $(docker ps -ql)
9784

9885
- name: Create Test Database
9986
run: |
100-
mysql -h 127.0.0.1 -u root -ptest -e "create database test"
87+
mysql -h 127.0.0.1 -u root -ptest -e "create database test"
10188
10289
- name: Execute Integration Tests
10390
run: vendor/bin/phpunit

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
1-
# SingleStore Driver for Laravel
1+
# SingleStore Driver for Laravel <!-- omit in toc -->
22

33
This repository contains a SingleStore Driver for Laravel.
44

5+
This package is currently in a pre-release beta, please use with caution and open any issues that you run into.
6+
7+
- [Install](#install)
8+
- [Usage](#usage)
9+
- [PHP Versions before 8.1](#php-versions-before-81)
10+
- [Migrations](#migrations)
11+
- [Rowstore Tables](#rowstore-tables)
12+
- [Reference Tables](#reference-tables)
13+
- [Global Temporary Tables](#global-temporary-tables)
14+
- [Sparse Columns](#sparse-columns)
15+
- [Sparse Tables](#sparse-tables)
16+
- [Shard Keys](#shard-keys)
17+
- [Sort Keys](#sort-keys)
18+
- [Series Timestamps](#series-timestamps)
19+
- [Computed Columns](#computed-columns)
20+
- [Testing](#testing)
21+
- [License](#license)
22+
- [Resources](#resources)
23+
- [User agreement](#user-agreement)
24+
525
## Install
626

727
You can install the package via composer:
@@ -10,6 +30,8 @@ You can install the package via composer:
1030
composer require singlestoredb/singlestoredb-laravel
1131
```
1232

33+
**This package requires pdo_mysql** to be installed. If you aren't sure check to see if `pdo_mysql` is listed when you run `php -i`.
34+
1335
## Usage
1436

1537
To enable the driver, head to your `config/database.php` file and create a new entry for SingleStore in your `connections`, and update your `default` to point to that new connection:

tests/BaseTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @author Aaron Francis <aaron@hammerstone.dev|https://twitter.com/aarondfrancis>
45
*/

tests/Hybrid/Json/JsonContainsTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function json_contains_strings()
3535
return;
3636
}
3737

38-
[$id1,] = $this->insertJsonData([
38+
[$id1] = $this->insertJsonData([
3939
['array' => ['en', 1, true, ['a' => 'b']]],
4040
['array' => ['es', 2, false, ['c' => 'd']]],
4141
]);
@@ -60,7 +60,7 @@ public function json_contains_double()
6060
return;
6161
}
6262

63-
[$id1,] = $this->insertJsonData([
63+
[$id1] = $this->insertJsonData([
6464
['array' => ['en', 1.5, true, ['a' => 'b']]],
6565
['array' => ['es', 2.5, false, ['c' => 'd']]],
6666
]);
@@ -85,7 +85,7 @@ public function json_contains_int()
8585
return;
8686
}
8787

88-
[$id1,] = $this->insertJsonData([
88+
[$id1] = $this->insertJsonData([
8989
['array' => ['en', 1, true, ['a' => 'b']]],
9090
['array' => ['es', 2, false, ['c' => 'd']]],
9191
]);
@@ -110,7 +110,7 @@ public function json_contains_bool()
110110
return;
111111
}
112112

113-
[$id1,] = $this->insertJsonData([
113+
[$id1] = $this->insertJsonData([
114114
['array' => ['en', 1, true, ['a' => 'b']]],
115115
['array' => ['es', 2, false, ['c' => 'd']]],
116116
]);
@@ -135,7 +135,7 @@ public function json_contains_json()
135135
return;
136136
}
137137

138-
[$id1,] = $this->insertJsonData([
138+
[$id1] = $this->insertJsonData([
139139
['array' => ['en', 1, true, ['a' => 'b']]],
140140
['array' => ['es', 2, false, ['c' => 'd']]],
141141
]);

tests/Hybrid/Json/JsonKeypathsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function it_compiles_column_only_without_path()
2727
return;
2828
}
2929

30-
[$id1,] = $this->insertJsonData([[
30+
[$id1] = $this->insertJsonData([[
3131
//
3232
], [
3333
1,
@@ -51,7 +51,7 @@ public function it_compiles_nested_json_path()
5151
return;
5252
}
5353

54-
[, $id2,] = $this->insertJsonData([[
54+
[, $id2] = $this->insertJsonData([[
5555
'value1' => ['value2' => ['value3' => ['value4' => 1]]],
5656
], [
5757
'value1' => ['value2' => ['value3' => ['value4' => 2]]],
@@ -77,7 +77,7 @@ public function it_compiles_nested_json_path_with_array_access()
7777
return;
7878
}
7979

80-
[$id1,] = $this->insertJsonData([[
80+
[$id1] = $this->insertJsonData([[
8181
'value1' => [['value2' => [[], [], [1]]]],
8282
], [
8383
'value1' => [['value2' => [[], [], [2]]]],

0 commit comments

Comments
 (0)