Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
Update Docs for Connection;
Browse files Browse the repository at this point in the history
  • Loading branch information
BOT-Man-JL committed Dec 10, 2016
1 parent 8f9a8f9 commit 4d17173
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/ORM-Lite.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ ORMapper (const string &connectionString);
Remarks:
- Construct a **O/R Mapper** to connect to `connectionString`;
- For SQLite, the `connectionString` is the **database name**;
- The `ORMapper` **Keeps** the **Connection**
and **Shares** the **Connection** with `Queryable`;
- **Disconnecting** at all related `ORMapper`/`Queryable` destructied;
### Transaction
Expand Down Expand Up @@ -326,7 +329,8 @@ Queryable<MyClass> Query (MyClass queryHelper);
Remarks:
- Return new `Queryable` object with `QueryResult` is `MyClass`;
- `MyClass` **MUST** be **Copy Constructible**
to Construct `queryHelper`;
to Construct a `queryHelper`;
- The `ORMapper` **Shares** the **Connection** with `Queryable`;
## `BOT_ORM::Queryable<QueryResult>`
Expand All @@ -342,6 +346,7 @@ Remarks:
- `QueryResult` specifies the **Row Type** of Query Result;
- `Select` will Get the one-or-zero-row Result for `agg` immediately;
- `ToVector` / `ToList` returns the Collection of `QueryResult`;
- The results are from the **Connection** of `Queryable`;
- If the Result is `null` for `NOT Nullable` Field,
it will throw `std::runtime_error`;
- `Expression` will be described later;
Expand All @@ -368,6 +373,7 @@ Remarks:
- `OrderBy` will **Append** `field` to Condition,
while Other functions will **Set** `DISTINCT`,
`expr`, `field` or `count` to Condition;
- New `Queryable` **Shares** the **Connection** of `this`;
- `Expression` will be described later;
### Construct New `QueryResult`
Expand All @@ -394,7 +400,8 @@ Remarks:
all `Nullable<T>`, where `T` is the Supported Types of `ORMAP`
(NOT `std::tuple` or `MyClass`);
- `onExpr` specifies the `ON` Expression for `JOIN`;
- All Functions will pass the **Conditions** of `this` to the new one;
- All Functions will copy the **Conditions** of `this` to the new one;
- New `Queryable` **Shares** the **Connection** of `this`;
- `Expression` will be described later;

### Compound Select
Expand All @@ -411,6 +418,7 @@ Remarks:
for `this` and `queryable`;
- All Functions will only **Inherit Conditions**
`OrderBy` and `Limit` from `this`;
- New `Queryable` **Shares** the **Connection** of `this`;
### Query SQL
Expand Down

0 comments on commit 4d17173

Please sign in to comment.