Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-kg committed Apr 17, 2020
1 parent 47863f7 commit 5b5998d
Showing 1 changed file with 53 additions and 1 deletion.
54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,58 @@

Abstraction Model for work with different databases

TODO more description
## Integrate to your project

```
$ wsjcpp install https://github.com/wsjcpp/wsjcpp-storages:master
```
Or include this files:

* src.wsjcpp/wsjcpp_core/wsjcpp_core.h
* src.wsjcpp/wsjcpp_core/wsjcpp_core.cpp
* src/wsjcpp_storages.h
* src/wsjcpp_storages.cpp

For working with this abstruct modeles you need install subpackage for *-mysql or create yourself support database

Lits of supports

* will be soon

## How to use

Cheche the supporting database implementation
```
if (WsjcppStorages::support("mysql")) {
// will support mysql database
}
```
List of implemented databases:

```
std::vector<std::string> vDbList = WsjcppStorages::list();
for (int i = 0; i < vDbList.size(); i++) {
std::cout << vDbList[i] << std::endl;
}
```

Create instance of storage for work with database:

```
WsjcppStorage* pStorage = nullptr;
std::string sDatabaseType = "mysql";
if (WsjcppStorages::support(sDatabaseType)) {
pStorage = WsjcppStorages::create(sDatabaseType);
pStorage->applyConfigFromFile(sDatabaseType + ".conf"); // apply connection config
}
// now you can create a connection to database:
if (pStorage != nullptr) {
WsjcppStorageConnection *pConnect = pStorage->connect();
}
```

Soon will be more information



0 comments on commit 5b5998d

Please sign in to comment.