[chore] fmt readme

This commit is contained in:
Anton Nesterov 2024-08-21 22:48:50 +02:00 committed by GitHub
parent 0669177a8b
commit b816b0ecdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -102,14 +102,15 @@ const db = new DAL({
url: "http://localhost:8111", url: "http://localhost:8111",
}); });
// SELECT * FROM test t WHERE name GLOB '*son' AND age >= 18
const rows = db const rows = db
.In("test t") .In("test t")
.Find({ .Find({
name: { $glob: "*son" }, name: { $glob: "*son" },
age: { $gte: 18 }, age: { $gte: 18 },
}) // SELECT * FROM test t WHERE name GLOB '*son' AND age >= 18 })
.As(UserDTO) // Map every row to DTO .As(UserDTO) // Map every row to DTO
.Rows(); // Get iterator .Rows();
for await (const row of rows) { for await (const row of rows) {
console.log(row); // Jason, Jackson console.log(row); // Jason, Jackson