Skip to content

Commit b536ce8

Browse files
authored
Merge pull request #389 from LASTRADA-Software/update/README
Update readme file
2 parents 9d4458c + 256d1e4 commit b536ce8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ In the presented example we used rename of the columns, for more details see how
101101
you can query the email and get access to the user record as well
102102

103103
```cpp
104-
auto dm = Light::DataMapper{};
105-
auto email = dm.QuerySingle<Email>(some_email_id).value_or(Email{});
104+
auto dm = Light::DataMapper::Create();
105+
auto email = dm->QuerySingle<Email>(some_email_id).value_or(Email{});
106106
auto user_name = email.user->name; // lazily loads the user record
107107
```
108108

@@ -171,8 +171,8 @@ struct CustomBindingC
171171

172172
Create a query to join those tables to get in a single query
173173
```cpp
174-
auto dm = DataMapper {};
175-
auto query = dm.FromTable(RecordTableName<CustomBindingA>)
174+
auto dm = Light::DataMapper::Create();
175+
auto query = dm->FromTable(RecordTableName<CustomBindingA>)
176176
.Select()
177177
.Fields<CustomBindingA, CustomBindingB>()
178178
.Field(QualifiedColumnName<"C.id">)
@@ -199,7 +199,7 @@ struct PartOfC
199199
SqlAnsiString<20> comment {};
200200
};
201201

202-
auto const records = dm.QueryToTuple<CustomBindingA, CustomBindingB, PartOfC>(query);
202+
auto const records = dm->Query<CustomBindingA, CustomBindingB, PartOfC>(query);
203203
for (auto const& [a, b, c]: records)
204204
{
205205
// ...
@@ -274,4 +274,4 @@ cmake --build build && ./build/src/examples/example
274274

275275
``` sh
276276
docker buildx build --progress=plain -f .github/DockerReflection --load .
277-
```
277+
```

0 commit comments

Comments
 (0)