-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from tarsil/feature/feature_integration
Integrations
- Loading branch information
Showing
34 changed files
with
1,139 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import saffier | ||
|
||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the and_ | ||
await User.query.filter( | ||
saffier.and_(User.columns.name == "Adam", User.columns.email == "[email protected]"), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import saffier | ||
|
||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the and_ | ||
await User.query.filter(saffier.and_(User.columns.name == "Adam")).filter( | ||
saffier.and_(User.columns.email == "[email protected]") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import saffier | ||
|
||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the and_ | ||
await User.query.filter( | ||
saffier.and_( | ||
User.columns.email.contains("saffier"), | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import saffier | ||
from saffier import Database, Registry | ||
|
||
database = Database("sqlite:///db.sqlite") | ||
models = Registry(database=database) | ||
|
||
|
||
class User(saffier.Model): | ||
first_name: str = saffier.CharField(max_length=50, null=True) | ||
email: str = saffier.EmailField(max_lengh=100, null=True) | ||
|
||
class Meta: | ||
registry = models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import saffier | ||
|
||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the not_ | ||
await User.query.filter(saffier.not_(User.columns.name == "Adam")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import saffier | ||
|
||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
await User.query.create(name="John", email="[email protected]") | ||
|
||
# Query using the not_ | ||
await User.query.filter(saffier.not_(User.columns.name == "Adam")).filter( | ||
saffier.not_(User.columns.email.contains("saffier")) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import saffier | ||
|
||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the not_ | ||
await User.query.filter( | ||
saffier.not_( | ||
User.columns.email.contains("saffier"), | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import saffier | ||
|
||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the or_ | ||
await User.query.filter( | ||
saffier.or_(User.columns.name == "Adam", User.columns.email == "[email protected]"), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import saffier | ||
|
||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the or_ | ||
await User.query.filter(saffier.or_(User.columns.name == "Adam")).filter( | ||
saffier.or_(User.columns.email == "[email protected]") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import saffier | ||
|
||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the or_ | ||
await User.query.filter( | ||
saffier.or_( | ||
User.columns.email.contains("saffier"), | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the and_ | ||
await User.query.and_(name="Adam", email="[email protected]") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the and_ | ||
await User.query.filter(name="Adam").and_(email="[email protected]") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the and_ | ||
await User.query.and_(email__icontains="saffier") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import saffier | ||
from saffier import Database, Registry | ||
|
||
database = Database("sqlite:///db.sqlite") | ||
models = Registry(database=database) | ||
|
||
|
||
class User(saffier.Model): | ||
first_name: str = saffier.CharField(max_length=50, null=True) | ||
email: str = saffier.EmailField(max_lengh=100, null=True) | ||
|
||
class Meta: | ||
registry = models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the not_ | ||
await User.query.not_(name="Adam") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
await User.query.create(name="John", email="[email protected]") | ||
|
||
# Query using the not_ | ||
await User.query.filter(email__icontains="saffier").not_(name__iexact="Adam") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the not_ | ||
await User.query.not_(email__icontains="saffier").not_(name__icontains="a") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the or_ | ||
await User.query.or_(name="Adam", email="[email protected]") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the or_ | ||
await User.query.or_(name="Adam").filter(email="[email protected]") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Create some records | ||
|
||
await User.query.create(name="Adam", email="[email protected]") | ||
await User.query.create(name="Eve", email="[email protected]") | ||
|
||
# Query using the multiple or_ | ||
await User.query.or_(email__icontains="saffier").or_(name__icontains="a") | ||
|
||
# Query using the or_ with multiple fields | ||
await User.query.or_(email__icontains="saffier", name__icontains="a") |
Oops, something went wrong.