Skip to content

Commit

Permalink
More on test/readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarasikee committed Aug 12, 2022
1 parent 356188a commit b68a777
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,32 @@ Tiny, Powerful, Beautiful

- [Motivation](#motivation)
- [Let's start](#lets-start)
- [@TinyTable](#lets-start)
- [@Column](#lets-start)

# Motivation

Let's say you want to build a small project that doesn't require a bulky relational database such as Postgres or MySQL.
Let's say you want to build a small project that doesn't require a bulky
relational database such as Postgres or MySQL.
Instead, you want to use a simple, in-memory database that will cover your needs.

That's where <b>TinyDB</b> comes in. <b>TinyDB</b> is a tiny, simple, and fast in-memory database that you can use to
store and retrieve data. It has all the features of a relational database, but it designed to be as lightweight and
That's where <b>TinyDB</b> comes in. <b>TinyDB</b> is a tiny, simple,
and fast in-memory database that you can use to
store and retrieve data. It has all the features of a relational database,
but it designed to be as lightweight and
simple as possible.

No need to install software or to set up a server. You're ready to go after installing dependencies.
No need to install software or to set up a server. You're ready to go after
installing dependencies.

# Let's start

Your entry point is ```@TinyTable``` decorator, where you pass table's name.

There are tons of decorators you can use to customize your database. In the example below, you can see ```@Column```
decorators.
No need to remember ton of decorators. Simply start with ```@Column({})```, add a
small bunch of properties,
and you are ready to go.
In the example below you will see the best way to use create user with TinyDB.

```typescript
@TinyTable("users")
Expand Down
4 changes: 2 additions & 2 deletions tests/findingTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export const findingTests = () => {
})

await t.step("Find one or first user", () => {
const user = userModel.findOne({isAdmin: true})
assertStrictEquals(user.toJSON().isAdmin, true)
const user = userModel.findOne({settings: {test: 1}})
assertStrictEquals(user.toJSON().settings.test, 1)
})

await t.step("Find users with nested searching 1", () => {
Expand Down

0 comments on commit b68a777

Please sign in to comment.