Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utilities #8

Merged
merged 7 commits into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 84 additions & 13 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,81 @@
===
Dataloom **`2.1.1`**
Dataloom **`2.2.0`**
===

### Release Notes - `dataloom`

We have release the new `dataloom` Version `2.1.0` (`2024-02-24`)
We have release the new `dataloom` Version `2.2.0` (`2024-02-24`)

##### Features

- updated documentation.
- Added operators `BETWEEN` and `NOT` in filters now ypu can use them.

```py
post = loom.find_one(
Post,
filters=Filter(
column="id",
operator="between",
value=[1, 7],
),
select=["id"],
)
post = loom.find_one(
Post,
filters=Filter(
column="id",
operator="not",
value=3,
),
select=["id"],
)
```

> Note that the `between` operator works on value ranges that are numbers.

- Distinct row selection has been added for the method `find_all()` and `find_many()`

```py
post = loom.find_many(
Post,
filters=Filter(
column="id",
operator="between",
value=[1, 7],
),
select=["completed"],
distinct=True,
)

post = loom.find_all(
Post,
select=["completed"],
distinct=True,
)
```

> The result will return the `distinct` rows of data based on the completed value.

- added utility functions `sum`, `avg`, `min`, `max` and `count` to the loom object.
```py
count = loom.count(
instance=Post,
filters=Filter(
column="id",
operator="between",
value=[1, 7],
),
column="id",
)
```
- Updated logger colors and formatting.

# Dataloom **`2.1.1`**

### Release Notes - `dataloom`

We have release the new `dataloom` Version `2.1.1` (`2024-02-24`)

##### Features

Expand Down Expand Up @@ -70,7 +141,7 @@ We have release the new `dataloom` Version `2.0.0` (`2024-02-21`)
- Now you can fetch your child relationship together in your query

```py
user = mysql_loom.find_one(
user = loom.find_one(
instance=User,
filters=[Filter(column="id", value=userId)],
include=[Include(model=Profile, select=["id", "avatar"], has="one")],
Expand All @@ -81,7 +152,7 @@ We have release the new `dataloom` Version `2.0.0` (`2024-02-21`)
- You can apply limits, offsets, filters and orders to your child associations during queries

```py
post = mysql_loom.find_one(
post = loom.find_one(
instance=Post,
filters=[Filter(column="userId", value=userId)],
select=["title", "id"],
Expand Down Expand Up @@ -124,7 +195,7 @@ We have release the new `dataloom` Version `2.0.0` (`2024-02-21`)

# now you can do this

profile = mysql_loom.find_many(
profile = loom.find_many(
instance=Profile,
)
print([Profile(**p) for p in profile]) # ? = [<Profile:id=1>]
Expand All @@ -140,20 +211,20 @@ We have release the new `dataloom` Version `2.0.0` (`2024-02-21`)
- **Before**

```py
res = mysql_loom.find_by_pk(Profile, pk=profileId, select={"id", "avatar"}) # invalid
res = mysql_loom.find_by_pk(Profile, pk=profileId, select=("id", "avatar")) # invalid
res = mysql_loom.find_by_pk(Profile, pk=profileId, select="id") # invalid
res = mysql_loom.find_by_pk(Profile, pk=profileId, select=["id"]) # valid
res = loom.find_by_pk(Profile, pk=profileId, select={"id", "avatar"}) # invalid
res = loom.find_by_pk(Profile, pk=profileId, select=("id", "avatar")) # invalid
res = loom.find_by_pk(Profile, pk=profileId, select="id") # invalid
res = loom.find_by_pk(Profile, pk=profileId, select=["id"]) # valid

```

- **Now**

```py
res = mysql_loom.find_by_pk(Profile, pk=profileId, select={"id", "avatar"}) # valid
res = mysql_loom.find_by_pk(Profile, pk=profileId, select=("id", "avatar")) # valid
res = mysql_loom.find_by_pk(Profile, pk=profileId, select="id") # valid
res = mysql_loom.find_by_pk(Profile, pk=profileId, select=["id"]) # valid
res = loom.find_by_pk(Profile, pk=profileId, select={"id", "avatar"}) # valid
res = loom.find_by_pk(Profile, pk=profileId, select=("id", "avatar")) # valid
res = loom.find_by_pk(Profile, pk=profileId, select="id") # valid
res = loom.find_by_pk(Profile, pk=profileId, select=["id"]) # valid

```

Expand Down
195 changes: 182 additions & 13 deletions README.md

Large diffs are not rendered by default.

Loading