Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin2/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
kostochkin committed Jan 7, 2024
2 parents 444f8d4 + 5ee368e commit 32e152b
Show file tree
Hide file tree
Showing 37 changed files with 510 additions and 1,535 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build and test

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-20.04
name: Erlang/OTP ${{matrix.otp}} / rebar3 ${{matrix.rebar3}}
strategy:
fail-fast: false
matrix:
otp: ['23.0.2', '24.1.3', '25.1.1']
rebar3: ['3.20.0']
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
rebar3-version: ${{matrix.rebar3}}
version-type: strict
- name: Compile
run: rebar3 compile
- name: Run tests
run: rebar3 eunit
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ rebar3.crashdump
.eunit
/ebin
/doc
rebar.lock
.project
.idea
rebar.lock
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

56 changes: 0 additions & 56 deletions Makefile

This file was deleted.

34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
BossDB: A sharded, caching, pooling, evented ORM for Erlang
===========================================================
[![Build Status](https://travis-ci.org/ErlyORM/boss_db.svg?branch=master)](https://travis-ci.org/ErlyORM/boss_db)

Attention! This is a master branch supporting Erlang 18 and above. For older Erlang versions use legacy branch.
[![Build and test](https://github.com/burbas/boss_db/actions/workflows/workflow.yml/badge.svg?branch=master)](https://github.com/burbas/boss_db/actions/workflows/workflow.yml)

**Important** This fork deviates from boss_db and does not support Erlang versions prior to 21. We've removed some of the database adapters since they were using very old libraries and we did not have time to port them.

Supported databases
-------------------

* *NEW* DynamoDB (experimental)
* DynamoDB (experimental)
* Mnesia
* MongoDB
* MySQL
* PostgreSQL
* Riak
* Tokyo Tyrant

Complete API references
-----------------------
Expand All @@ -34,7 +33,7 @@ boss_cache:start(CacheOptions), % If you want cacheing with Memcached
boss_news:start() % Mandatory! Hopefully will be optional one day

DBOptions = [
{adapter, mock | tyrant | riak | mysql | pgsql | mnesia | mongodb},
{adapter, mock | riak | mysql | pgsql | mnesia},
{db_host, HostName::string()},
{db_port, PortNumber::integer()},
{db_username, UserName::string()},
Expand Down Expand Up @@ -83,6 +82,8 @@ EtsCacheServerOpts = [
]
```



Introduction
------------

Expand Down Expand Up @@ -155,8 +156,8 @@ Similarly, you could iterate over all the puppies of a particular breed:

```erlang
Breed = boss_db:find("breed-47"),
lists:map(fun(Puppy) ->
io:format("Puppy: ~p~n", [Puppy:name()])
lists:map(fun(Puppy) ->
io:format("Puppy: ~p~n", [Puppy:name()])
end, Breed:puppies())
```

Expand Down Expand Up @@ -291,7 +292,7 @@ BossNews is suited to providing real-time notifications and alerts. For example,
if you want to log each time a puppy's name is changed,

```erlang
boss_news:watch("puppy-*.name",
boss_news:watch("puppy-*.name",
fun(updated, {Puppy, 'name', OldName, NewName}) ->
error_logger:info_msg("Puppy's name changed from ~p to ~p", [OldName, NewName])
end)
Expand Down Expand Up @@ -339,3 +340,18 @@ are useful PKs when data are being aggregated from multiple sources.

The default Id type ::serial() may be explicitly supplied. Note that
all Id types, valid or otherwise, pass type validation.


Test
----

To test mysql adapter, you need provide mysql connection env on test. Example:

```
MYSQL_HOST=127.0.0.1 \
MYSQL_PORT=3306 \
MYSQL_USER=user \
MYSQL_PASSWORD=test \
MYSQL_TEST_DBNAME=test \
rebar3 eunit --suite=boss_db_adapter_mysql_otp_test
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
-module(boss_db_adapter_types).
-type model_operator() :: 'not_matches'|matches|contains|not_contains|contains_all|not_contains_all|
contains_any| contains_none|in|not_in.
-export_type([model_operator/0]).
20 changes: 0 additions & 20 deletions otp_chained_functions_r16b.patch

This file was deleted.

161 changes: 0 additions & 161 deletions priv/rebar/boss_db_rebar.erl

This file was deleted.

Loading

0 comments on commit 32e152b

Please sign in to comment.