Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1 prototype #53

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5e8b175
Prototype of the next version
azazeal Feb 2, 2024
cd89400
driver/badger: do not export private wrapper fields
azazeal Feb 19, 2024
b163685
clarified the behavior of (DB).List
azazeal Feb 19, 2024
d2e7342
nosql: implemented the ErrRace sentinel error for supported datastores
azazeal Feb 20, 2024
a26edd8
driver/postgresql: deal better with reduced permissions
azazeal Feb 21, 2024
89afe27
driver/postgresql: reworked test suite
azazeal Feb 21, 2024
e3978b2
driver/mysql: reworked test suite
azazeal Feb 21, 2024
92682ef
driver/mysql: work under restrictive priviledges
azazeal Feb 21, 2024
aaa0b7f
internal/each: initial implementation of the package
azazeal Feb 21, 2024
30c5e19
driver/postgresql: refactored to support the internal/each package
azazeal Feb 21, 2024
54e7436
driver/mysql: refactored to support the internal/each package
azazeal Feb 21, 2024
b1de638
internal/each: organized test package imports
azazeal Feb 21, 2024
edff0c0
driver/badger: refactored to support the internal/each package
azazeal Feb 21, 2024
b349565
driver/postgresql: renamed db.p to db.pool for clarity
azazeal Feb 21, 2024
10e81a9
added race condition detection test
azazeal Feb 22, 2024
e442fa0
reworked README
azazeal Feb 22, 2024
6ae24e0
removed race support
azazeal Feb 22, 2024
fda0932
edited readme
azazeal Feb 22, 2024
5b0dc25
fix: test suites
azazeal Feb 22, 2024
fe8b63b
dbtest: shorter long values
azazeal Feb 22, 2024
72735a0
internal/token: test uniqueness
azazeal Feb 22, 2024
95e8422
Makefile: support our own linter rules
azazeal Feb 22, 2024
95a2fb9
ci: use a max parallelism of one when testing
azazeal Feb 22, 2024
44cfa8b
ci: consistent health intervals & timeouts
azazeal Feb 22, 2024
95c8fcf
ci: added connection timeouts
azazeal Feb 22, 2024
6383cc5
work with more test databases
azazeal Feb 22, 2024
a302cc3
ci: be verbose when testing
azazeal Feb 22, 2024
9231174
ci: use a test timeout
azazeal Feb 22, 2024
64d09a9
dbtest: invalid buckets are also the ones ending with whitespace
azazeal Feb 22, 2024
c561e8c
ci: increased timeout
azazeal Feb 22, 2024
2243201
ci: use gotestsum
azazeal Feb 22, 2024
3ae290c
Makefile: booted
azazeal Feb 22, 2024
fc02b73
ci: fix gotestsum
azazeal Feb 22, 2024
9fa1006
ci: do not run the build
azazeal Feb 22, 2024
ef2eb5a
typo fixes
azazeal Mar 4, 2024
d54371a
dox: clarified usage of token.New a bit better
azazeal Mar 4, 2024
da32c8a
internal/token: New now returns tokens with length in [minSize, maxSize]
azazeal Mar 4, 2024
ced5d84
ci: increased test timeout to 10m
azazeal Mar 4, 2024
c7a13ab
tests: increased deadline to 0.5m
azazeal Mar 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 54 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,81 @@ jobs:
only-latest-golang: false
run-codeql: true
run-test: false
run-build: false
secrets: inherit

test:
runs-on: ubuntu-latest

env:
DBPASSWORD: ${{ github.sha }}

services:
postgres:
image: postgres
image: postgres:11-alpine
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_PASSWORD: ${{ env.DBPASSWORD }}
ports:
- 5432:5432
- 5432/tcp
options: >-
--health-cmd pg_isready
--health-cmd "pg_isready -d postgres -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5

mysql:
image: mysql:5.7
env:
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: password
MYSQL_ROOT_PASSWORD: ${{ env.DBPASSWORD }}
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
- 3306/tcp
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5

mariadb:
image: mariadb:10.2
env:
MARIADB_ROOT_PASSWORD: ${{ env.DBPASSWORD }}
ports:
- 3306/tcp
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5

strategy:
matrix:
go: [ 'stable', 'oldstable' ]

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
check-latest: true
- name: Test
run: V=1 make ci-test

- name: Install gotestsum
run: go install gotest.tools/gotestsum@v1.11.0

- name: Checkout
uses: actions/checkout@v4

- name: Run Test Suite
run: |
gotestsum -- -timeout 10m -race -coverpkg=./... -coverprofile=coverprofile -covermode=atomic ./...
env:
GOTESTSUM_JSONFILE: gotestsum.json

TEST_POSTGRES_DSN: postgres://postgres:${{ env.DBPASSWORD }}@localhost:${{ job.services.postgres.ports['5432'] }}/nosql_test_${{ matrix.go }}?sslmode=disable&connect_timeout=5
TEST_MYSQL_DSN: root:${{ env.DBPASSWORD }}@tcp(localhost:${{ job.services.mysql.ports['3306'] }})/nosql_test_${{ matrix.go }}?timeout=5s
TEST_MARIADB_DSN: root:${{ env.DBPASSWORD }}@tcp(localhost:${{ job.services.mariadb.ports['3306'] }})/nosql_test_${{ matrix.go }}?timeout=5s

- name: Annotate Test Suite Results
if: ${{ (success() || failure()) && hashFiles('gotestsum.json') != '' }}
uses: guyarb/golang-test-annotations@v0.7.0
with:
test-results: gotestsum.json
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@
*.out

# Vendor directory
vendor/*
vendor/*

# Ignore direnv files
.envrc
65 changes: 0 additions & 65 deletions Makefile

This file was deleted.

17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ NoSQL is an abstraction layer for data persistence.

This project is in development, the API is not stable.

# Implementations
## Supported data stores

The current version comes with a few implementations inlcuding Mysql, Badger,
and BoltDB, but implementations are on the roadmap.
- [x] [BoltDB](https://github.com/etcd-io/bbolt)
- [x] [Badger](https://github.com/dgraph-io/badger) (`v1`, `v2`, `v3` & `v4`)
- [x] [MariaDB](https://mariadb.org/) (`v10.2`+)
- [x] [MySQL](https://www.mysql.com/) (`v5.7`+)
- [x] [PostgreSQL](https://www.postgresql.org/) (`v11`+)

- [ ] Memory
- [x] [BoltDB](https://github.com/etcd-io/bbolt) etcd fork.
- [x] Badger
- [x] MariaDB/MySQL
- [x] PostgreSQL
- [ ] Cassandra
- [ ] ...
More implementations are on the way.
Loading
Loading