API Reference¶
Models¶
-
class
Model
(**kwargs)¶ Models provide a 1-to-1 mapping to database tables. Subclasses of
Model
declare any number ofField
instances as class attributes. These fields correspond to columns on the table.Table-level operations, such as
select()
,update()
,insert()
, anddelete()
, are implemented as classmethods. Row-level operations such assave()
anddelete_instance()
are implemented as instancemethods.Parameters: kwargs – Initialize the model, assigning the given key/values to the appropriate fields. Example:
class User(Model): username = CharField() join_date = DateTimeField(default=datetime.datetime.now) is_admin = BooleanField() u = User(username='charlie', is_admin=True)
-
classmethod
select
(*selection)¶ Parameters: selection – A list of model classes, field instances, functions or expressions. If no argument is provided, all columns for the given model will be selected. Return type: a SelectQuery
for the givenModel
.Examples of selecting all columns (default):
User.select().where(User.active == True).order_by(User.username)
Example of selecting all columns on Tweet and the parent model, User. When the
user
foreign key is accessed on a Tweet instance no additional query will be needed (see N+1 for more details):(Tweet .select(Tweet, User) .join(User) .order_by(Tweet.created_date.desc()))
-
classmethod
update
(**update)¶ Parameters: update – mapping of field-name to expression Return type: an UpdateQuery
for the givenModel
Example showing users being marked inactive if their registration expired:
q = User.update(active=False).where(User.registration_expired == True) q.execute() # Execute the query, updating the database.
Example showing an atomic update:
q = PageView.update(count=PageView.count + 1).where(PageView.url == url) q.execute() # execute the query, updating the database.
Note
When an update query is executed, the number of rows modified will be returned.
-
classmethod
insert
(**insert)¶ Insert a new row into the database. If any fields on the model have default values, these values will be used if the fields are not explicitly set in the
insert
dictionary.Parameters: insert – mapping of field or field-name to expression. Return type: an InsertQuery
for the givenModel
.Example showing creation of a new user:
q = User.insert(username='admin', active=True, registration_expired=False) q.execute() # perform the insert.
You can also use
Field
objects as the keys:User.insert(**{User.username: 'admin'}).execute()
If you have a model with a default value on one of the fields, and that field is not specified in the
insert
parameter, the default will be used:class User(Model): username = CharField() active = BooleanField(default=True) # This INSERT query will automatically specify `active=True`: User.insert(username='charlie')
Note
When an insert query is executed on a table with an auto-incrementing primary key, the primary key of the new row will be returned.
-
insert_many
(rows)¶ Insert multiple rows at once. The
rows
parameter must be an iterable that yields dictionaries. As withinsert()
, fields that are not specified in the dictionary will use their default value, if one exists.Note
Due to the nature of bulk inserts, each row must contain the same fields. The following will not work:
Person.insert_many([ {'first_name': 'Peewee', 'last_name': 'Herman'}, {'first_name': 'Huey'}, # Missing "last_name"! ])
Parameters: rows – An iterable containing dictionaries of field-name-to-value. Return type: an InsertQuery
for the givenModel
.Example of inserting multiple Users:
usernames = ['charlie', 'huey', 'peewee', 'mickey'] row_dicts = ({'username': username} for username in usernames) # Insert 4 new rows. User.insert_many(row_dicts).execute()
Because the
rows
parameter can be an arbitrary iterable, you can also use a generator:def get_usernames(): for username in ['charlie', 'huey', 'peewee']: yield {'username': username} User.insert_many(get_usernames()).execute()
-
classmethod
insert_from
(fields, query)¶ Insert rows into the table using a query as the data source. This API should be used for INSERT INTO...SELECT FROM queries.
Parameters: - fields – The field objects to map the selected data into.
- query – The source of the new rows.
Return type: an
InsertQuery
for the givenModel
.Example of inserting data across tables for denormalization purposes:
source = (User .select(User.username, fn.COUNT(Tweet.id)) .join(Tweet, JOIN.LEFT_OUTER) .group_by(User.username)) UserTweetDenorm.insert_from( [UserTweetDenorm.username, UserTweetDenorm.num_tweets], source).execute()
-
classmethod
delete
()¶ Return type: a DeleteQuery
for the givenModel
.Example showing the deletion of all inactive users:
q = User.delete().where(User.active == False) q.execute() # remove the rows
Warning
This method performs a delete on the entire table. To delete a single instance, see
Model.delete_instance()
.
-
classmethod
raw
(sql, *params)¶ Parameters: - sql – a string SQL expression
- params – any number of parameters to interpolate
Return type: a
RawQuery
for the givenModel
Example selecting rows from the User table:
q = User.raw('select id, username from users') for user in q: print user.id, user.username
Note
Generally the use of
raw
is reserved for those cases where you can significantly optimize a select query. It is useful for select queries since it will return instances of the model.
-
classmethod
create
(**attributes)¶ Parameters: attributes – key/value pairs of model attributes Return type: a model instance with the provided attributes Example showing the creation of a user (a row will be added to the database):
user = User.create(username='admin', password='test')
Note
The create() method is a shorthand for instantiate-then-save.
-
classmethod
get
(*args)¶ Parameters: args – a list of query expressions, e.g. User.username == 'foo'
Return type: Model
instance or raisesDoesNotExist
exceptionGet a single row from the database that matches the given query. Raises a
<model-class>.DoesNotExist
if no rows are returned:user = User.get(User.username == username, User.active == True)
This method is also exposed via the
SelectQuery
, though it takes no parameters:active = User.select().where(User.active == True) try: user = active.where( (User.username == username) & (User.active == True) ).get() except User.DoesNotExist: user = None
Note
The
get()
method is shorthand for selecting with a limit of 1. It has the added behavior of raising an exception when no matching row is found. If more than one row is found, the first row returned by the database cursor will be used.
-
classmethod
get_or_create
([defaults=None[, **kwargs]])¶ Parameters: - defaults (dict) – A dictionary of values to set on newly-created model instances.
- kwargs – Django-style filters specifying which model to get, and what values to apply to new instances.
Returns: A 2-tuple containing the model instance and a boolean indicating whether the instance was created.
This function attempts to retrieve a model instance based on the provided filters. If no matching model can be found, a new model is created using the parameters specified by the filters and any values in the
defaults
dictionary.Example without
get_or_create
:# Without `get_or_create`, we might write: try: person = Person.get( (Person.first_name == 'John') & (Person.last_name == 'Lennon')) except Person.DoesNotExist: person = Person.create( first_name='John', last_name='Lennon', birthday=datetime.date(1940, 10, 9))
Equivalent code using
get_or_create
:person, created = Person.get_or_create( first_name='John', last_name='Lennon', defaults={'birthday': datetime.date(1940, 10, 9)})
-
classmethod
alias
()¶ Return type: ModelAlias
instanceThe
alias()
method is used to create self-joins.Example:
Parent = Category.alias() sq = (Category .select(Category, Parent) .join(Parent, on=(Category.parent == Parent.id)) .where(Parent.name == 'parent category'))
Note
When using a
ModelAlias
in a join, you must explicitly specify the join condition.
-
classmethod
create_table
([fail_silently=False])¶ Parameters: fail_silently (bool) – If set to True
, the method will check for the existence of the table before attempting to create.Create the table for the given model, along with any constraints and indexes.
Example:
database.connect() SomeModel.create_table() # Execute the create table query.
-
classmethod
drop_table
([fail_silently=False[, cascade=False]])¶ Parameters: - fail_silently (bool) – If set to
True
, the query will check for the existence of the table before attempting to remove. - cascade (bool) – Drop table with
CASCADE
option.
Drop the table for the given model.
- fail_silently (bool) – If set to
-
classmethod
table_exists
()¶ Return type: Boolean whether the table for this model exists in the database
-
classmethod
sqlall
()¶ Returns: A list of queries required to create the table and indexes.
-
save
([force_insert=False[, only=None]])¶ Parameters: - force_insert (bool) – Whether to force execution of an insert
- only (list) – A list of fields to persist – when supplied, only the given fields will be persisted.
Save the given instance, creating or updating depending on whether it has a primary key. If
force_insert=True
an INSERT will be issued regardless of whether or not the primary key exists.Example showing saving a model instance:
user = User() user.username = 'some-user' # does not touch the database user.save() # change is persisted to the db
-
delete_instance
([recursive=False[, delete_nullable=False]])¶ Parameters: - recursive – Delete this instance and anything that depends on it, optionally updating those that have nullable dependencies
- delete_nullable – If doing a recursive delete, delete all dependent objects regardless of whether it could be updated to NULL
Delete the given instance. Any foreign keys set to cascade on delete will be deleted automatically. For more programmatic control, you can call with recursive=True, which will delete any non-nullable related models (those that are nullable will be set to NULL). If you wish to delete all dependencies regardless of whether they are nullable, set
delete_nullable=True
.example:
some_obj.delete_instance() # it is gone forever
-
dependencies
([search_nullable=False])¶ Parameters: search_nullable (bool) – Search models related via a nullable foreign key Return type: Generator expression yielding queries and foreign key fields Generate a list of queries of dependent models. Yields a 2-tuple containing the query and corresponding foreign key field. Useful for searching dependencies of a model, i.e. things that would be orphaned in the event of a delete.
-
dirty_fields
¶ Return a list of fields that were manually set.
Return type: list Note
If you just want to persist modified fields, you can call
model.save(only=model.dirty_fields)
.
-
is_dirty
()¶ Return whether any fields were manually set.
Return type: bool
-
prepared
()¶ This method provides a hook for performing model initialization after the row data has been populated.
-
classmethod
Fields¶
-
Field(null=False, index=False, unique=False, verbose_name=None, help_text=None, db_column=None, default=None, choices=None, primary_key=False, sequence=None, constraints=None, schema=None, **kwargs):
The base class from which all other field types extend.
Parameters: - null (bool) – whether this column can accept
None
orNULL
values - index (bool) – whether to create an index for this column when creating the table
- unique (bool) – whether to create a unique index for this column when creating the table
- verbose_name (string) – specify a “verbose name” for this field, useful for metadata purposes
- help_text (string) – specify some instruction text for the usage/meaning of this field
- db_column (string) – column name to use for underlying storage, useful for compatibility with legacy databases
- default – a value to use as an uninitialized default
- choices – an iterable of 2-tuples mapping
value
todisplay
- primary_key (bool) – whether to use this as the primary key for the table
- sequence (string) – name of sequence (if backend supports it)
- constraints (list) – a list of constraints, e.g.
[Check('price > 0')]
. - schema (string) – name of schema (if backend supports it)
- kwargs – named attributes containing values that may pertain to specific field subclasses, such as “max_length” or “decimal_places”
-
db_field = '<some field type>'
Attribute used to map this field to a column type, e.g. “string” or “datetime”
-
_is_bound
¶ Boolean flag indicating if the field is attached to a model class.
-
model_class
¶ The model the field belongs to. Only applies to bound fields.
-
name
¶ The name of the field. Only applies to bound fields.
-
db_value
(value)¶ Parameters: value – python data type to prep for storage in the database Return type: converted python datatype
-
python_value
(value)¶ Parameters: value – data coming from the backend storage Return type: python data type
-
coerce
(value)¶ This method is a shorthand that is used, by default, by both
db_value
andpython_value
. You can usually get away with just implementing this.Parameters: value – arbitrary data from app or backend Return type: python data type
- null (bool) – whether this column can accept
-
class
IntegerField
¶ Stores: integers
-
db_field = 'int'
-
-
class
BigIntegerField
¶ Stores: big integers
-
db_field = 'bigint'
-
-
class
PrimaryKeyField
¶ Stores: auto-incrementing integer fields suitable for use as primary key.
-
db_field = 'primary_key'
-
-
class
FloatField
¶ Stores: floating-point numbers
-
db_field = 'float'
-
-
class
DoubleField
¶ Stores: double-precision floating-point numbers
-
db_field = 'double'
-
-
class
DecimalField
¶ Stores: decimal numbers, using python standard library
Decimal
objectsAdditional attributes and values:
max_digits
10
decimal_places
5
auto_round
False
rounding
decimal.DefaultContext.rounding
-
db_field = 'decimal'
-
-
class
CharField
¶ Stores: small strings (0-255 bytes)
Additional attributes and values:
max_length
255
-
db_field = 'string'
-
-
class
TextField
¶ Stores: arbitrarily large strings
-
db_field = 'text'
-
-
class
DateTimeField
¶ Stores: python
datetime.datetime
instancesAccepts a special parameter
formats
, which contains a list of formats the datetime can be encoded with. The default behavior is:'%Y-%m-%d %H:%M:%S.%f' # year-month-day hour-minute-second.microsecond '%Y-%m-%d %H:%M:%S' # year-month-day hour-minute-second '%Y-%m-%d' # year-month-day
Note
If the incoming value does not match a format, it will be returned as-is
-
db_field = 'datetime'
-
year
¶ An expression suitable for extracting the year, for example to retrieve all blog posts from 2013:
Blog.select().where(Blog.pub_date.year == 2013)
-
month
¶ An expression suitable for extracting the month from a stored date.
-
day
¶ An expression suitable for extracting the day from a stored date.
-
hour
¶ An expression suitable for extracting the hour from a stored time.
-
minute
¶ An expression suitable for extracting the minute from a stored time.
-
second
¶ An expression suitable for extracting the second from a stored time.
-
-
class
DateField
¶ Stores: python
datetime.date
instancesAccepts a special parameter
formats
, which contains a list of formats the date can be encoded with. The default behavior is:'%Y-%m-%d' # year-month-day '%Y-%m-%d %H:%M:%S' # year-month-day hour-minute-second '%Y-%m-%d %H:%M:%S.%f' # year-month-day hour-minute-second.microsecond
Note
If the incoming value does not match a format, it will be returned as-is
-
db_field = 'date'
-
year
¶ An expression suitable for extracting the year, for example to retrieve all people born in 1980:
Person.select().where(Person.dob.year == 1983)
-
-
class
TimeField
¶ Stores: python
datetime.time
instancesAccepts a special parameter
formats
, which contains a list of formats the time can be encoded with. The default behavior is:'%H:%M:%S.%f' # hour:minute:second.microsecond '%H:%M:%S' # hour:minute:second '%H:%M' # hour:minute '%Y-%m-%d %H:%M:%S.%f' # year-month-day hour-minute-second.microsecond '%Y-%m-%d %H:%M:%S' # year-month-day hour-minute-second
Note
If the incoming value does not match a format, it will be returned as-is
-
db_field = 'time'
-
hour
¶ Extract the hour from a time, for example to retreive all events occurring in the evening:
Event.select().where(Event.time.hour > 17)
-
-
class
BooleanField
¶ Stores:
True
/False
-
db_field = 'bool'
-
-
class
BlobField
¶ Store arbitrary binary data.
-
class
UUIDField
¶ Store
UUID
values.Note
Currently this field is only supported by
PostgresqlDatabase
.
-
class
ForeignKeyField
(rel_model[, related_name=None[, on_delete=None[, on_update=None[, to_field=None[, ...]]]]])¶ Stores: relationship to another model
Parameters: - rel_model – related
Model
class or the string ‘self’ if declaring a self-referential foreign key - related_name (string) – attribute to expose on related model
- on_delete (string) – on delete behavior, e.g.
on_delete='CASCADE'
. - on_update (string) – on update behavior.
- to_field – the field (or field name) on
rel_model
the foreign key references. Defaults to the primary key field forrel_model
.
class User(Model): name = CharField() class Tweet(Model): user = ForeignKeyField(User, related_name='tweets') content = TextField() # "user" attribute >>> some_tweet.user <User: charlie> # "tweets" related name attribute >>> for tweet in charlie.tweets: ... print tweet.content Some tweet Another tweet Yet another tweet
Note
Foreign keys do not have a particular
db_field
as they will take their field type depending on the type of primary key on the model they are related to.Note
If you manually specify a
to_field
, that field must be either a primary key or have a unique constraint.- rel_model – related
-
class
CompositeKey
(*fields)¶ Specify a composite primary key for a model. Unlike the other fields, a composite key is defined in the model’s
Meta
class after the fields have been defined. It takes as parameters the string names of the fields to use as the primary key:class BlogTagThrough(Model): blog = ForeignKeyField(Blog, related_name='tags') tag = ForeignKeyField(Tag, related_name='blogs') class Meta: primary_key = CompositeKey('blog', 'tag')
Query Types¶
-
class
Query
¶ The parent class from which all other query classes are drived. While you will not deal with
Query
directly in your code, it implements some methods that are common across all query types.-
where
(*expressions)¶ Parameters: expressions – a list of one or more expressions Return type: a Query
instanceExample selection users where the username is equal to ‘somebody’:
sq = SelectQuery(User).where(User.username == 'somebody')
Example selecting tweets made by users who are either editors or administrators:
sq = SelectQuery(Tweet).join(User).where( (User.is_editor == True) | (User.is_admin == True))
Example of deleting tweets by users who are no longer active:
dq = DeleteQuery(Tweet).where( Tweet.user << User.select().where(User.active == False)) dq.execute() # perform the delete query
Note
where()
calls are chainable. Multiple calls will be “AND”-ed together.
-
join
(model, join_type=None, on=None)¶ Parameters: - model – the model to join on. there must be a
ForeignKeyField
between the currentquery context
and the model passed in. - join_type – allows the type of
JOIN
used to be specified explicitly, one ofJOIN.INNER
,JOIN.LEFT_OUTER
,JOIN.FULL
- on – if multiple foreign keys exist between two models, this parameter is the ForeignKeyField to join on.
Return type: a
Query
instanceGenerate a
JOIN
clause from the currentquery context
to themodel
passed in, and establishesmodel
as the newquery context
.Example selecting tweets and joining on user in order to restrict to only those tweets made by “admin” users:
sq = SelectQuery(Tweet).join(User).where(User.is_admin == True)
Example selecting users and joining on a particular foreign key field. See the example app for a real-life usage:
sq = SelectQuery(User).join(Relationship, on=Relationship.to_user)
- model – the model to join on. there must be a
-
switch
(model)¶ Parameters: model – model to switch the query context
to.Return type: a clone of the query with a new query context Switches the
query context
to the given model. Raises an exception if the model has not been selected or joined on previously. Useful for performing multiple joins from a single table.The following example selects from blog and joins on both entry and user:
sq = SelectQuery(Blog).join(Entry).switch(Blog).join(User)
-
alias
(alias=None)¶ Parameters: alias (str) – A string to alias the result of this query Return type: a Query instance Assign an alias to given query, which can be used as part of a subquery.
-
sql
()¶ Return type: a 2-tuple containing the appropriate SQL query and a tuple of parameters
-
execute
()¶ Execute the given query
-
scalar
([as_tuple=False])¶ Parameters: as_tuple (bool) – return the row as a tuple or a single value Return type: the resulting row, either as a single value or tuple Provide a way to retrieve single values from select queries, for instance when performing an aggregation.
>>> PageView.select(fn.Count(fn.Distinct(PageView.url))).scalar() 100 # <-- there are 100 distinct URLs in the pageview table
-
-
class
SelectQuery
(model_class, *selection)¶ By far the most complex of the query classes available in peewee. It supports all clauses commonly associated with select queries.
Methods on the select query can be chained together.
SelectQuery
implements an__iter__()
method, allowing it to be iterated to return model instances.Parameters: - model – a
Model
class to perform query on - selection – a list of models, fields, functions or expressions
If no selection is provided, it will default to all the fields of the given model.
Example selecting some user instances from the database. Only the
id
andusername
columns are selected. When iterated, will return instances of theUser
model:sq = SelectQuery(User, User.id, User.username) for user in sq: print user.username
Example selecting users and additionally the number of tweets made by the user. The
User
instances returned will have an additional attribute, ‘count’, that corresponds to the number of tweets made:sq = (SelectQuery( User, User, fn.Count(Tweet.id).alias('count')) .join(Tweet) .group_by(User))
-
select
(*selection)¶ Parameters: selection – a list of expressions, which can be model classes or fields. if left blank, will default to all the fields of the given model. Return type: SelectQuery
Note
Usually the selection will be specified when the instance is created. This method simply exists for the case when you want to modify the SELECT clause independent of instantiating a query.
query = User.select() query = query.select(User.username)
-
from_
(*args)¶ Parameters: args – one or more expressions, for example Model
orSelectQuery
instance(s). if left blank, will default to the table of the given model.Return type: SelectQuery
# rather than a join, select from both tables and join with where. query = User.select().from_(User, Blog).where(Blog.user == User.id)
-
group_by
(*clauses)¶ Parameters: clauses – a list of expressions, which can be model classes or individual field instances Return type: SelectQuery
Group by one or more columns. If a model class is provided, all the fields on that model class will be used.
Example selecting users, joining on tweets, and grouping by the user so a count of tweets can be calculated for each user:
sq = (User .select(User, fn.Count(Tweet.id).alias('count')) .join(Tweet) .group_by(User))
-
having
(*expressions)¶ Parameters: expressions – a list of one or more expressions Return type: SelectQuery
Here is the above example selecting users and tweet counts, but restricting the results to those users who have created 100 or more tweets:
sq = (User .select(User, fn.Count(Tweet.id).alias('count')) .join(Tweet) .group_by(User) .having(fn.Count(Tweet.id) > 100))
-
order_by
(*clauses)¶ Parameters: clauses – a list of fields, calls to field.[asc|desc]()
or one or more expressionsReturn type: SelectQuery
Example of ordering users by username:
User.select().order_by(User.username)
Example of selecting tweets and ordering them first by user, then newest first:
query = (Tweet .select() .join(User) .order_by( User.username, Tweet.created_date.desc()))
You can also use
+
and-
prefixes to indicate ascending or descending order if you prefer:query = (Tweet .select() .join(User) .order_by( +User.username, -Tweet.created_date))
A more complex example ordering users by the number of tweets made (greatest to least), then ordered by username in the event of a tie:
tweet_ct = fn.Count(Tweet.id) sq = (User .select(User, tweet_ct.alias('count')) .join(Tweet) .group_by(User) .order_by(tweet_ct.desc(), User.username))
-
window
(*windows)¶ Parameters: windows (Window) – One or more Window
instances.Add one or more window definitions to this query.
window = Window(partition_by=[fn.date_trunc('day', PageView.timestamp)]) query = (PageView .select( PageView.url, PageView.timestamp, fn.Count(PageView.id).over(window=window)) .window(window) .order_by(PageView.timestamp))
-
limit
(num)¶ Parameters: num (int) – limit results to num
rows
-
offset
(num)¶ Parameters: num (int) – offset results by num
rows
-
paginate
(page_num, paginate_by=20)¶ Parameters: - page_num – a 1-based page number to use for paginating results
- paginate_by – number of results to return per-page
Return type: Shorthand for applying a
LIMIT
andOFFSET
to the query.Page indices are 1-based, so page 1 is the first page.
User.select().order_by(User.username).paginate(3, 20) # get users 41-60
-
distinct
([is_distinct=True])¶ Parameters: is_distinct – See notes. Return type: SelectQuery
Indicates that this query should only return distinct rows. Results in a
SELECT DISTINCT
query.Note
The value for
is_distinct
should either be a boolean, in which case the query will (or won’t) be DISTINCT.You can specify a list of one or more expressions to generate a
DISTINCT ON
query, e.g..distinct([Model.col1, Model.col2])
.
-
for_update
([for_update=True[, nowait=False]])¶ Return type: SelectQuery
Indicate that this query should lock rows for update. If
nowait
isTrue
then the database will raise anOperationalError
if it cannot obtain the lock.
-
naive
()¶ Return type: SelectQuery
Flag this query indicating it should only attempt to reconstruct a single model instance for every row returned by the cursor. If multiple tables were queried, the columns returned are patched directly onto the single model instance.
Generally this method is useful for speeding up the time needed to construct model instances given a database cursor.
Note
this can provide a significant speed improvement when doing simple iteration over a large result set.
-
iterator
()¶ Return type: iterable
By default peewee will cache rows returned by the cursor. This is to prevent things like multiple iterations, slicing and indexing from triggering extra queries. When you are iterating over a large number of rows, however, this cache can take up a lot of memory. Using
iterator()
will save memory by not storing all the returned model instances.# iterate over large number of rows. for obj in Stats.select().iterator(): # do something. pass
-
tuples
()¶ Return type: SelectQuery
Flag this query indicating it should simply return raw tuples from the cursor. This method is useful when you either do not want or do not need full model instances.
-
dicts
()¶ Return type: SelectQuery
Flag this query indicating it should simply return dictionaries from the cursor. This method is useful when you either do not want or do not need full model instances.
-
aggregate_rows
()¶ Return type: SelectQuery
This method provides one way to avoid the N+1 query problem.
Consider a webpage where you wish to display a list of users and all of their associated tweets. You could approach this problem by listing the users, then for each user executing a separate query to retrieve their tweets. This is the N+1 behavior, because the number of queries varies depending on the number of users. Conventional wisdom is that it is preferable to execute fewer queries. Peewee provides several ways to avoid this problem.
You can use the
prefetch()
helper, which usesIN
clauses to retrieve the tweets for the listed users.Another method is to select both the user and the tweet data in a single query, then de-dupe the users, aggregating the tweets in the process.
The raw column data might appear like this:
# user.id, user.username, tweet.id, tweet.user_id, tweet.message [1, 'charlie', 1, 1, 'hello'], [1, 'charlie', 2, 1, 'goodbye'], [2, 'no-tweets', NULL, NULL, NULL], [3, 'huey', 3, 3, 'meow'], [3, 'huey', 4, 3, 'purr'], [3, 'huey', 5, 3, 'hiss'],
We can infer from the
JOIN
clause that the user data will be duplicated, and therefore by de-duping the users, we can collect their tweets in one go and iterate over the users and tweets transparently.query = (User .select(User, Tweet) .join(Tweet, JOIN.LEFT_OUTER) .order_by(User.username, Tweet.id) .aggregate_rows()) # .aggregate_rows() tells peewee to de-dupe the rows. for user in query: print user.username for tweet in user.tweets: print ' ', tweet.message # Producing the following output: charlie hello goodbye huey meow purr hiss no-tweets
Warning
Be sure that you specify an
ORDER BY
clause that ensures duplicated data will appear in consecutive rows.Note
You can specify arbitrarily complex joins, though for more complex queries it may be more efficient to use
prefetch()
. In short, try both and see what works best for your data-set.Note
For more information, see the Avoiding N+1 queries document and the Using aggregate_rows sub-section.
-
annotate
(related_model, aggregation=None)¶ Parameters: - related_model – related
Model
on which to perform aggregation, must be linked byForeignKeyField
. - aggregation – the type of aggregation to use, e.g.
fn.Count(Tweet.id).alias('count')
Return type: Annotate a query with an aggregation performed on a related model, for example, “get a list of users with the number of tweets for each”:
>>> User.select().annotate(Tweet)
If
aggregation
is None, it will default tofn.Count(related_model.id).alias('count')
but can be anything:>>> user_latest = User.select().annotate(Tweet, fn.Max(Tweet.created_date).alias('latest'))
Note
If the
ForeignKeyField
isnullable
, then aLEFT OUTER
join may need to be used:query = (User .select() .join(Tweet, JOIN.LEFT_OUTER) .switch(User) # Switch query context back to `User`. .annotate(Tweet))
- related_model – related
-
aggregate
(aggregation)¶ Parameters: aggregation – a function specifying what aggregation to perform, for example fn.Max(Tweet.created_date)
.Method to look at an aggregate of rows using a given function and return a scalar value, such as the count of all rows or the average value of a particular column.
-
count
([clear_limit=False])¶ Parameters: clear_limit (bool) – Remove any limit or offset clauses from the query before counting. Return type: an integer representing the number of rows in the current query Note
If the query has a GROUP BY, DISTINCT, LIMIT, or OFFSET clause, then the
wrapped_count()
method will be used instead.>>> sq = SelectQuery(Tweet) >>> sq.count() 45 # number of tweets >>> deleted_tweets = sq.where(Tweet.status == DELETED) >>> deleted_tweets.count() 3 # number of tweets that are marked as deleted
-
wrapped_count
([clear_limit=True])¶ Parameters: clear_limit (bool) – Remove any limit or offset clauses from the query before counting. Return type: an integer representing the number of rows in the current query Wrap the count query in a subquery. Additional overhead but will give correct counts when performing
DISTINCT
queries or those withGROUP BY
clauses.Note
count()
will automatically default towrapped_count()
in the event the query is distinct or has a grouping.
-
exists
()¶ Return type: boolean whether the current query will return any rows. uses an optimized lookup, so use this rather than get()
.sq = User.select().where(User.active == True) if sq.where(User.username == username, User.active == True).exists(): authenticated = True
-
get
()¶ Return type: Model
instance or raisesDoesNotExist
exceptionGet a single row from the database that matches the given query. Raises a
<model-class>.DoesNotExist
if no rows are returned:active = User.select().where(User.active == True) try: user = active.where(User.username == username).get() except User.DoesNotExist: user = None
This method is also exposed via the
Model
api, in which case it accepts arguments that are translated to the where clause:user = User.get(User.active == True, User.username == username)
-
first
()¶ Return type: Model
instance orNone
if no resultsFetch the first row from a query. The result will be cached in case the entire query result-set should be iterated later.
-
execute
()¶ Return type: QueryResultWrapper
Executes the query and returns a
QueryResultWrapper
for iterating over the result set. The results are managed internally by the query and whenever a clause is added that would possibly alter the result set, the query is marked for re-execution.
-
__iter__
()¶ Executes the query and returns populated model instances:
for user in User.select().where(User.active == True): print user.username
-
__getitem__
(value)¶ Parameters: value – Either an index or a slice
object.Return the model instance(s) at the requested indices. To get the first model, for instance:
query = User.select().order_by(User.username) first_user = query[0] first_five = query[:5]
-
__or__
(rhs)¶ Parameters: rhs – Either a SelectQuery
or aCompoundSelect
Return type: CompoundSelect
Create a
UNION
query with the right-hand object. The result will contain all values from both the left and right queries.customers = Customer.select(Customer.city).where(Customer.state == 'KS') stores = Store.select(Store.city).where(Store.state == 'KS') # Get all cities in kansas where we have either a customer or a store. all_cities = (customers | stores).order_by(SQL('city'))
Note
SQLite does not allow
ORDER BY
orLIMIT
clauses on the components of a compound query, however SQLite does allow these clauses on the final, compound result. This applies toUNION (ALL)
,INTERSECT
, andEXCEPT
.
-
__and__
(rhs)¶ Parameters: rhs – Either a SelectQuery
or aCompoundSelect
Return type: CompoundSelect
Create an
INTERSECT
query. The result will contain values that are in both the left and right queries.customers = Customer.select(Customer.city).where(Customer.state == 'KS') stores = Store.select(Store.city).where(Store.state == 'KS') # Get all cities in kanasas where we have both customers and stores. cities = (customers & stores).order_by(SQL('city'))
-
__sub__
(rhs)¶ Parameters: rhs – Either a SelectQuery
or aCompoundSelect
Return type: CompoundSelect
Create an
EXCEPT
query. The result will contain values that are in the left-hand query but not in the right-hand query.customers = Customer.select(Customer.city).where(Customer.state == 'KS') stores = Store.select(Store.city).where(Store.state == 'KS') # Get all cities in kanasas where we have customers but no stores. cities = (customers - stores).order_by(SQL('city'))
-
__xor__
(rhs)¶ Parameters: rhs – Either a SelectQuery
or aCompoundSelect
Return type: CompoundSelect
Create an symmetric difference query. The result will contain values that are in either the left-hand query or the right-hand query, but not both.
customers = Customer.select(Customer.city).where(Customer.state == 'KS') stores = Store.select(Store.city).where(Store.state == 'KS') # Get all cities in kanasas where we have either customers with no # store, or a store with no customers. cities = (customers ^ stores).order_by(SQL('city'))
- model – a
-
class
UpdateQuery
(model_class, **kwargs)¶ Parameters: - model –
Model
class on which to perform update - kwargs – mapping of field/value pairs containing columns and values to update
Example in which users are marked inactive if their registration expired:
uq = UpdateQuery(User, active=False).where(User.registration_expired == True) uq.execute() # Perform the actual update
Example of an atomic update:
atomic_update = UpdateQuery(PageCount, count = PageCount.count + 1).where( PageCount.url == url) atomic_update.execute() # will perform the actual update
-
execute
()¶ Return type: Number of rows updated Performs the query
-
on_conflict
([action=None])¶ Add a SQL
ON CONFLICT
clause with the specified action to the givenUPDATE
query. Valid actions are:- ROLLBACK
- ABORT
- FAIL
- IGNORE
- REPLACE
Specifying
None
for the action will execute a normalUPDATE
query.Note
This feature is only available on SQLite databases.
- model –
-
class
InsertQuery
(model_class[, field_dict=None[, rows=None[, fields=None[, query=None]]]])¶ Creates an
InsertQuery
instance for the given model.Parameters: - field_dict (dict) – A mapping of either field or field-name to value.
- rows (iterable) – An iterable of dictionaries containing a mapping of field or field-name to value.
- fields (list) – A list of field objects to insert data into (only used in combination with the
query
parameter). - query – A
SelectQuery
to use as the source of data.
Basic example:
>>> fields = {'username': 'admin', 'password': 'test', 'active': True} >>> iq = InsertQuery(User, fields) >>> iq.execute() # insert new row and return primary key 2L
Example inserting multiple rows:
users = [ {'username': 'charlie', 'active': True}, {'username': 'peewee', 'active': False}, {'username': 'huey', 'active': True}] iq = InsertQuery(User, rows=users) iq.execute()
Example inserting using a query as the data source:
query = (User .select(User.username, fn.COUNT(Tweet.id)) .join(Tweet, JOIN.LEFT_OUTER) .group_by(User.username)) iq = InsertQuery( UserTweetDenorm, fields=[UserTweetDenorm.username, UserTweetDenorm.num_tweets], query=query) iq.execute()
-
execute
()¶ Return type: primary key of the new row Performs the query
-
upsert
([upsert=True])¶ Perform an INSERT OR REPLACE query.
Note
This feature is only available on SQLite databases.
-
on_conflict
([action=None])¶ Add a SQL
ON CONFLICT
clause with the specified action to the givenINSERT
query. SpecifyingREPLACE
is equivalent to using theupsert()
method. Valid actions are:- ROLLBACK
- ABORT
- FAIL
- IGNORE
- REPLACE
Specifying
None
for the action will execute a normalINSERT
query.Note
This feature is only available on SQLite databases.
-
return_id_list
([return_id_list=True])¶ By default, when doing bulk INSERTs, peewee will not return the list of generated primary keys. However, if the database supports returning primary keys via
INSERT ... RETURNING
, this method instructs peewee to return the generated list of IDs.Note
Currently only PostgreSQL supports this behavior. While other databases support bulk inserts, they will simply return
True
instead.Example:
usernames = [ {'username': username} for username in ['charlie', 'huey', 'mickey']] query = User.insert_many(usernames).return_id_list() user_ids = query.execute() print user_ids # prints something like [1, 2, 3]
-
class
DeleteQuery
(model_class)¶ Creates a DELETE query for the given model.
Note
DeleteQuery will not traverse foreign keys or ensure that constraints are obeyed, so use it with care.
Example deleting users whose account is inactive:
dq = DeleteQuery(User).where(User.active == False)
-
execute
()¶ Return type: Number of rows deleted Performs the query
-
-
class
RawQuery
(model_class, sql, *params)¶ Allows execution of an arbitrary query and returns instances of the model via a
QueryResultsWrapper
.Note
Generally you will only need this for executing highly optimized SELECT queries.
Warning
If you are executing a parameterized query, you must use the correct interpolation string for your database. SQLite uses
'?'
and most others use'%s'
.Example selecting users with a given username:
>>> rq = RawQuery(User, 'SELECT * FROM users WHERE username = ?', 'admin') >>> for obj in rq.execute(): ... print obj <User: admin>
-
tuples
()¶ Return type: RawQuery
Flag this query indicating it should simply return raw tuples from the cursor. This method is useful when you either do not want or do not need full model instances.
-
dicts
()¶ Return type: RawQuery
Flag this query indicating it should simply return raw dicts from the cursor. This method is useful when you either do not want or do not need full model instances.
-
execute
()¶ Return type: a QueryResultWrapper
for iterating over the result set. The results are instances of the given model.Performs the query
-
-
class
CompoundSelect
(model_class, lhs, operator, rhs)¶ Compound select query.
Parameters: - model_class – The type of model to return, by default the model class
of the
lhs
query. - lhs – Left-hand query, either a
SelectQuery
or aCompoundQuery
. - operator – A
Node
instance used to join the two queries, for exampleSQL('UNION')
. - rhs – Right query, either a
SelectQuery
or aCompoundQuery
.
- model_class – The type of model to return, by default the model class
of the
-
prefetch
(sq, *subqueries)¶ Parameters: - sq –
SelectQuery
instance - subqueries – one or more
SelectQuery
instances to prefetch forsq
. You can also pass models, but they will be converted into SelectQueries.
Return type: SelectQuery
with related instances pre-populatedPre-fetch the appropriate instances from the subqueries and apply them to their corresponding parent row in the outer query. This function will eagerly load the related instances specified in the subqueries. This is a technique used to save doing O(n) queries for n rows, and rather is O(k) queries for k subqueries.
For example, consider you have a list of users and want to display all their tweets:
# let's impost some small restrictions on our queries users = User.select().where(User.active == True) tweets = Tweet.select().where(Tweet.published == True) # this will perform 2 queries users_pf = prefetch(users, tweets) # now we can: for user in users_pf: print user.username for tweet in user.tweets_prefetch: print '- ', tweet.content
You can prefetch an arbitrary number of items. For instance, suppose we have a photo site, User -> Photo -> (Comments, Tags). That is, users can post photos, and these photos can have tags and comments on them. If we wanted to fetch a list of users, all their photos, and all the comments and tags on the photos:
users = User.select() published_photos = Photo.select().where(Photo.published == True) published_comments = Comment.select().where( (Comment.is_spam == False) & (Comment.num_flags < 3)) # note that we are just passing the Tag model -- it will be converted # to a query automatically users_pf = prefetch(users, published_photos, published_comments, Tag) # now we can iterate users, photos, and comments/tags for user in users_pf: for photo in user.photo_set_prefetch: for comment in photo.comment_set_prefetch: # ... for tag in photo.tag_set_prefetch: # ...
Note
Subqueries must be related by foreign key and can be arbitrarily deep
Note
For more information, see the Avoiding N+1 queries document and the Using prefetch sub-section.
Warning
prefetch()
can use up lots of RAM when the result set is large, and will not warn you if you are doing something dangerous, so it is up to you to know when to use it. Additionally, because of the semantics of subquerying, there may be some cases when prefetch does not act as you expect (for instance, when applying aLIMIT
to subqueries, but there may be others) – please report anything you think is a bug to github.- sq –
Database and its subclasses¶
-
class
Database
(database[, threadlocals=True[, autocommit=True[, fields=None[, ops=None[, autorollback=False[, **connect_kwargs]]]]]])¶ Parameters: - database – the name of the database (or filename if using sqlite)
- threadlocals (bool) – whether to store connections in a threadlocal
- autocommit (bool) – automatically commit every query executed by calling
execute()
- fields (dict) – a mapping of
db_field
to database column type, e.g. ‘string’ => ‘varchar’ - ops (dict) – a mapping of operations understood by the querycompiler to expressions
- autorollback (bool) – automatically rollback when an exception occurs while executing a query.
- connect_kwargs – any arbitrary parameters to pass to the database driver when connecting
The
connect_kwargs
dictionary is used for vendor-specific parameters that will be passed back directly to your database driver, allowing you to specify theuser
,host
andpassword
, for instance. For more information and examples, see the vendor-specific parameters document.Note
If your database name is not known when the class is declared, you can pass
None
in as the database name which will mark the database as “deferred” and any attempt to connect while in this state will raise an exception. To initialize your database, call theDatabase.init()
method with the database name.For an in-depth discussion of run-time database configuration, see the Run-time database configuration section.
A high-level API for working with the supported database engines. The database class:
- Manages the underlying database connection.
- Executes queries.
- Manage transactions and savepoints.
- Create and drop tables and indexes.
- Introspect the database.
-
commit_select = False
Whether to issue a commit after executing a select query. With some engines can prevent implicit transactions from piling up.
-
compiler_class = QueryCompiler
A class suitable for compiling queries
-
compound_operations = ['UNION', 'INTERSECT', 'EXCEPT']
Supported compound query operations.
-
compound_select_parentheses = False
Whether
UNION
(or other compoundSELECT
queries) allow parentheses around the queries.
-
distinct_on = False
Whether the database supports
DISTINCT ON
statements.
-
drop_cascade = False
Whether the database supports cascading drop table queries.
-
field_overrides = {}
A mapping of field types to database column types, e.g.
{'primary_key': 'SERIAL'}
-
foreign_keys = True
Whether the given backend enforces foreign key constraints.
-
for_update = False
Whether the given backend supports selecting rows for update
-
for_update_nowait = False
Whether the given backend supports selecting rows for update
-
insert_many = True
Whether the database supports multiple
VALUES
clauses forINSERT
queries.
-
insert_returning = False
Whether the database supports returning the primary key for newly inserted rows.
-
interpolation = '?'
The string used by the driver to interpolate query parameters
-
op_overrides = {}
A mapping of operation codes to string operations, e.g.
{OP.LIKE: 'LIKE BINARY'}
-
quote_char = '"'
The string used by the driver to quote names
-
reserved_tables = []
Table names that are reserved by the backend – if encountered in the application a warning will be issued.
-
savepoints = True
Whether the given backend supports savepoints.
-
sequences = False
Whether the given backend supports sequences
-
subquery_delete_same_table = True
Whether the given backend supports deleting rows using a subquery that selects from the same table
-
window_functions = False
Whether the given backend supports window functions.
-
init
(database[, **connect_kwargs])¶ This method is used to initialize a deferred database. For details on configuring your database at run-time, see the Run-time database configuration section.
Parameters: - database – the name of the database (or filename if using sqlite)
- connect_kwargs – any arbitrary parameters to pass to the database driver when connecting
-
connect
()¶ Establishes a connection to the database
Note
By default, connections will be stored on a threadlocal, ensuring connections are not shared across threads. To disable this behavior, initialize the database with
threadlocals=False
.
-
close
()¶ Closes the connection to the database (if one is open)
Note
If you initialized with
threadlocals=True
, only a connection local to the calling thread will be closed.
-
initialize_connection
(conn)¶ Perform additional intialization on a newly-opened connection. For example, if you are using SQLite you may want to enable foreign key constraint enforcement (off by default).
Here is how you might use this hook to enable foreign key enforcement on SQLite:
class SqliteFKDatabase(SqliteDatabase): def initialize_connection(self, conn): self.execute_sql('PRAGMA foreign_keys=ON;')
-
get_conn
()¶ Return type: a connection to the database, creates one if does not exist
-
get_cursor
()¶ Return type: a cursor for executing queries
-
last_insert_id
(cursor, model)¶ Parameters: - cursor – the database cursor used to perform the insert query
- model – the model class that was just created
Return type: the primary key of the most recently inserted instance
-
rows_affected
(cursor)¶ Return type: number of rows affected by the last query
-
compiler
()¶ Return type: an instance of QueryCompiler
using the field and op overrides specified.
-
execute_sql
(sql[, params=None[, require_commit=True]])¶ Parameters: - sql – a string sql query
- params – a list or tuple of parameters to interpolate
Note
You can configure whether queries will automatically commit by using the
set_autocommit()
andDatabase.get_autocommit()
methods.
-
begin
()¶ Initiate a new transaction. By default not implemented as this is not part of the DB-API 2.0, but provided for API compatibility.
-
commit
()¶ Call
commit()
on the active connection, committing the current transaction.
-
rollback
()¶ Call
rollback()
on the active connection, rolling back the current transaction.
-
set_autocommit
(autocommit)¶ Parameters: autocommit – a boolean value indicating whether to turn on/off autocommit.
-
get_autocommit
()¶ Return type: a boolean value indicating whether autocommit is enabled.
-
get_tables
([schema=None])¶ Return type: a list of table names in the database.
-
get_indexes
(table[, schema=None])¶ Return type: a list of IndexMetadata
instances, representing the indexes for the given table.
-
get_columns
(table[, schema=None])¶ Return type: a list of ColumnMetadata
instances, representing the columns for the given table.
-
get_primary_keys
(table[, schema=None])¶ Return type: a list containing the primary key column name(s) for the given table.
-
get_foreign_keys
(table[, schema=None])¶ Return type: a list of ForeignKeyMetadata
instances, representing the foreign keys for the given table.
-
sequence_exists
(sequence_name)¶ Rtype boolean:
-
create_table
(model_class[, safe=True])¶ Parameters: - model_class –
Model
class. - safe (bool) – If True, the table will not be created if it already exists.
Warning
Unlike
Model.create_table()
, this method does not create indexes or constraints. This method will only create the table itself. If you wish to create the table along with any indexes and constraints, use eitherModel.create_table()
orDatabase.create_tables()
.- model_class –
-
create_index
(model_class, fields[, unique=False])¶ Parameters: - model_class –
Model
table on which to create index - fields – field(s) to create index on (either field instances or field names)
- unique – whether the index should enforce uniqueness
- model_class –
-
create_foreign_key
(model_class, field[, constraint=None])¶ Parameters: - model_class –
Model
table on which to create foreign key constraint - field –
Field
object - constraint (str) – Name to give foreign key constraint.
Manually create a foreign key constraint using an
ALTER TABLE
query. This is primarily used when creating a circular foreign key dependency, for example:PostProxy = Proxy() class User(Model): username = CharField() favorite_post = ForeignKeyField(PostProxy, null=True) class Post(Model): title = CharField() author = ForeignKeyField(User, related_name='posts') PostProxy.initialize(Post) # Create tables. The foreign key from Post -> User will be created # automatically, but the foreign key from User -> Post must be added # manually. User.create_table() Post.create_table() # Manually add the foreign key constraint on `User`, since we could # not add it until we had created the `Post` table. db.create_foreign_key(User, User.favorite_post)
- model_class –
-
create_sequence
(sequence_name)¶ Parameters: sequence_name – name of sequence to create Note
only works with database engines that support sequences
-
drop_table
(model_class[, fail_silently=False[, cascade=False]])¶ Parameters: - model_class –
Model
table to drop - fail_silently (bool) – if
True
, query will add aIF EXISTS
clause - cascade (bool) – drop table with
CASCADE
option.
- model_class –
-
drop_sequence
(sequence_name)¶ Parameters: sequence_name – name of sequence to drop Note
only works with database engines that support sequences
-
create_tables
(models[, safe=False])¶ Parameters: - models (list) – A list of models.
- safe (bool) – Check first whether the table exists before attempting to create it.
This method should be used for creating tables as it will resolve the model dependency graph and ensure the tables are created in the correct order. This method will also create any indexes and constraints defined on the models.
Usage:
db.create_tables([User, Tweet, Something], safe=True)
-
drop_tables
(models[, safe=False[, cascade=False]])¶ Parameters: - models (list) – A list of models.
- safe (bool) – Check the table exists before attempting to drop it.
- cascade (bool) – drop table with
CASCADE
option.
This method should be used for dropping tables, as it will resolve the model dependency graph and ensure the tables are dropped in the correct order.
Usage:
db.drop_tables([User, Tweet, Something], safe=True)
-
atomic
()¶ Execute statements in either a transaction or a savepoint. The outer-most call to atomic will use a transaction, and any subsequent nested calls will use savepoints.
atomic
can be used as either a context manager or a decorator.Note
For most use-cases, it makes the most sense to always use
atomic()
when you wish to execute queries in a transaction. The benefit of usingatomic
is that you do not need to manually keep track of the transaction stack depth, as this will be managed for you.Context manager example code:
with db.atomic() as txn: perform_some_operations() with db.atomic() as nested_txn: do_other_things() if something_bad_happened(): # Roll back these changes, but preserve the changes # made in the outer block. nested_txn.rollback()
Decorator example code:
@db.atomic() def create_user(username): # This function will execute in a transaction/savepoint. return User.create(username=username)
-
transaction
()¶ Execute statements in a transaction using either a context manager or decorator. If an error is raised inside the wrapped block, the transaction will be rolled back, otherwise statements are committed when exiting. Transactions can also be explicitly rolled back or committed within the transaction block by calling
rollback()
orcommit()
. If you manually commit or roll back, a new transaction will be started automatically.Nested blocks can be wrapped with
transaction
- the database will keep a stack and only commit when it reaches the end of the outermost function / block.Context manager example code:
# delete a blog instance and all its associated entries, but # do so within a transaction with database.transaction(): blog.delete_instance(recursive=True) # Explicitly roll back a transaction. with database.transaction() as txn: do_some_stuff() if something_bad_happened(): # Roll back any changes made within this block. txn.rollback()
Decorator example code:
@database.transaction() def transfer_money(from_acct, to_acct, amt): from_acct.charge(amt) to_acct.pay(amt) return amt
-
commit_on_success
(func)¶ Note
Use
atomic()
ortransaction()
instead.
-
savepoint
([sid=None])¶ Execute statements in a savepoint using either a context manager or decorator. If an error is raised inside the wrapped block, the savepoint will be rolled back, otherwise statements are committed when exiting. Like
transaction()
, a savepoint can also be explicitly rolled-back or committed by callingrollback()
orcommit()
. If you manually commit or roll back, a new savepoint will not be created.Savepoints can be thought of as nested transactions.
Parameters: sid (str) – An optional string identifier for the savepoint. Context manager example code:
with db.transaction() as txn: do_some_stuff() with db.savepoint() as sp1: do_more_things() with db.savepoint() as sp2: even_more() # Oops, something bad happened, roll back # just the changes made in this block. if something_bad_happened(): sp2.rollback()
-
execution_context
([with_transaction=True])¶ Create an
ExecutionContext
context manager or decorator. Blocks wrapped with an ExecutionContext will run using their own connection. By default, the wrapped block will also run in a transaction, although this can be disabled specifyinwith_transaction=False
.For more explanation of
ExecutionContext
, see the Advanced Connection Management section.Warning
ExecutionContext is very new and has not been tested extensively.
-
classmethod
register_fields
(fields)¶ Register a mapping of field overrides for the database class. Used to register custom fields or override the defaults.
Parameters: fields (dict) – A mapping of db_field
to column type
-
classmethod
register_ops
(ops)¶ Register a mapping of operations understood by the QueryCompiler to their SQL equivalent, e.g.
{OP.EQ: '='}
. Used to extend the types of field comparisons.Parameters: fields (dict) – A mapping of db_field
to column type
-
extract_date
(date_part, date_field)¶ Return an expression suitable for extracting a date part from a date field. For instance, extract the year from a
DateTimeField
.Parameters: - date_part (str) – The date part attribute to retrieve. Valid options are: “year”, “month”, “day”, “hour”, “minute” and “second”.
- date_field (Field) – field instance storing a datetime, date or time.
Return type: an expression object.
-
sql_error_handler
(exception, sql, params, require_commit)¶ This hook is called when an error is raised executing a query, allowing your application to inject custom error handling behavior. The default implementation simply reraises the exception.
class SqliteDatabaseCustom(SqliteDatabase): def sql_error_handler(self, exception, sql, params, require_commit): # Perform some custom behavior, for example close the # connection to the database. self.close() # Re-raise the exception. raise exception
-
class
SqliteDatabase
(Database)¶ Database
subclass that works with the “sqlite3” driver. In addition to the default database parameters,SqliteDatabase
also accepts a journal_mode parameter which will configure the journaling mode.To use write-ahead log:
db = SqliteDatabase('my_app.db', journal_mode='WAL')
-
insert_many = True *if* using SQLite <IP_ADDRESS> or newer.
-
-
class
MySQLDatabase
(Database)¶ Database
subclass that works with either “MySQLdb” or “pymysql”.-
commit_select = True
-
compound_operations = ['UNION']
-
for_update = True
-
subquery_delete_same_table = False
-
-
class
PostgresqlDatabase
(Database)¶ Database
subclass that works with the “psycopg2” driver-
commit_select = True
-
compound_select_parentheses = True
-
distinct_on = True
-
for_update = True
-
for_update_nowait = True
-
insert_returning = True
-
sequences = True
-
window_functions = True
-
register_unicode = True
Control whether the
UNICODE
andUNICODEARRAY
psycopg2 extensions are loaded automatically.
-
Transaction, Savepoint and ExecutionContext¶
The easiest way to create transactions and savepoints is to use Database.atomic()
. The atomic()
method will create a transaction or savepoint depending on the level of nesting.
with db.atomic() as txn:
# The outer-most call will be a transaction.
with db.atomic() as sp:
# Nested calls will be savepoints instead.
execute_some_statements()
-
class
transaction
(database)¶ Context manager that encapsulates a database transaction. Statements executed within the wrapped block will be committed at the end of the block unless an exception occurs, in which case any changes will be rolled back.
Warning
Transactions should not be nested as this could lead to unpredictable behavior in the event of an exception in a nested block. If you wish to use nested transactions, use the
atomic()
method, which will create a transaction at the outer-most layer and use savepoints for nested blocks.Note
In practice you should not create
transaction
objects directly, but rather use theDatabase.transaction()
method.-
commit
()¶ Manually commit any pending changes and begin a new transaction.
-
rollback
()¶ Manually roll-back any pending changes and begin a new transaction.
-
-
class
savepoint
(database[, sid=None])¶ Context manager that encapsulates a savepoint (nested transaction). Statements executed within the wrapped block will be committed at the end of the block unless an exception occurs, in which case any changes will be rolled back.
Warning
Savepoints must be created within a transaction. It is recommended that you use
atomic()
instead of manually managing the transaction+savepoint stack.Note
In practice you should not create
savepoint
objects directly, but rather use theDatabase.savepoint()
method.-
commit
()¶ Manually commit any pending changes. If the savepoint is manually committed and additional changes are made, they will be executed in the context of the outer block.
-
rollback
()¶ Manually roll-back any pending changes. If the savepoint is manually rolled-back and additional changes are made, they will be executed in the context of the outer block.
-
-
class
ExecutionContext
(database[, with_transaction=True])¶ ExecutionContext provides a way to explicitly run statements in a dedicated connection. Typically a single database connection is maintained per-thread, but in some situations you may wish to explicitly force a new, separate connection. To accomplish this, you can create an
ExecutionContext
. Statements executed in the wrapped block will be run in a transaction by default, though you can disable this by specifyingwith_transaction=False
.Note
Rather than instantiating
ExecutionContext
directly, useDatabase.execution_context()
.Example code:
# This will return the connection associated with the current thread. conn = db.get_conn() with db.execution_context(): # This will be a new connection object. If you are using the # connection pool, it may be an unused connection from the pool. ctx_conn = db.get_conn() # This statement is executed using the new `ctx_conn`. User.create(username='huey') # At the end of the wrapped block, the connection will be closed and the # transaction, if one exists, will be committed. # This statement is executed using the regular `conn`. User.create(username='mickey')
-
class
Using
(database, models[, with_transaction=True])¶ For the duration of the wrapped block, all queries against the given
models
will use the specifieddatabase
. Optionally these queries can be run inside a transaction by specifyingwith_transaction=True
.Using
provides, in short, a way to run queries on a list of models using a manually specified database.Parameters:
Metadata Types¶
-
class
IndexMetadata
(name, sql, columns, unique, table)¶ -
name
¶ The name of the index.
-
sql
¶ The SQL query used to generate the index.
-
columns
¶ A list of columns that are covered by the index.
-
unique
¶ A boolean value indicating whether the index has a unique constraint.
-
table
¶ The name of the table containing this index.
-
-
class
ColumnMetadata
(name, data_type, null, primary_key, table)¶ -
name
¶ The name of the column.
-
data_type
¶ The data type of the column
-
null
¶ A boolean value indicating whether
NULL
is permitted in this column.
-
primary_key
¶ A boolean value indicating whether this column is a primary key.
-
table
¶ The name of the table containing this column.
-
-
class
ForeignKeyMetadata
(column, dest_table, dest_column, table)¶ -
column
¶ The column containing the foreign key (the “source”).
-
dest_table
¶ The table referenced by the foreign key.
-
dest_column
¶ The column referenced by the foreign key (on
dest_table
).
-
table
¶ The name of the table containing this foreign key.
-
Misc¶
-
class
fn
¶ A helper class that will convert arbitrary function calls to SQL function calls.
To express functions in peewee, use the
fn
object. The way it works is anything to the right of the “dot” operator will be treated as a function. You can pass that function arbitrary parameters which can be other valid expressions.For example:
Peewee expression Equivalent SQL fn.Count(Tweet.id).alias('count')
Count(t1."id") AS count
fn.Lower(fn.Substr(User.username, 1, 1))
Lower(Substr(t1."username", 1, 1))
fn.Rand().alias('random')
Rand() AS random
fn.Stddev(Employee.salary).alias('sdv')
Stddev(t1."salary") AS sdv
-
over
([partition_by=None[, order_by=None[, window=None]]])¶ Basic support for SQL window functions.
Parameters: Examples:
# Get the list of employees and the average salary for their dept. query = (Employee .select( Employee.name, Employee.department, Employee.salary, fn.Avg(Employee.salary).over( partition_by=[Employee.department])) .order_by(Employee.name)) # Rank employees by salary. query = (Employee .select( Employee.name, Employee.salary, fn.rank().over( order_by=[Employee.salary]))) # Get a list of page-views, along with avg pageviews for that day. query = (PageView .select( PageView.url, PageView.timestamp, fn.Count(PageView.id).over( partition_by=[fn.date_trunc( 'day', PageView.timestamp)])) .order_by(PageView.timestamp)) # Same as above but using a window class. window = Window(partition_by=[fn.date_trunc('day', PageView.timestamp)]) query = (PageView .select( PageView.url, PageView.timestamp, fn.Count(PageView.id).over(window=window)) .window(window) # Need to include our Window here. .order_by(PageView.timestamp))
-
-
class
SQL
(sql, *params)¶ Add fragments of SQL to a peewee query. For example you might want to reference an aliased name.
Parameters: - sql (str) – Arbitrary SQL string.
- params – Arbitrary query parameters.
# Retrieve user table and "annotate" it with a count of tweets for each # user. query = (User .select(User, fn.Count(Tweet.id).alias('ct')) .join(Tweet, JOIN.LEFT_OUTER) .group_by(User)) # Sort the users by number of tweets. query = query.order_by(SQL('ct DESC'))
-
class
Window
([partition_by=None[, order_by=None]])¶ Create a
WINDOW
definition.Parameters: Examples:
# Get the list of employees and the average salary for their dept. window = Window(partition_by=[Employee.department]).alias('dept_w') query = (Employee .select( Employee.name, Employee.department, Employee.salary, fn.Avg(Employee.salary).over(window)) .window(window) .order_by(Employee.name))
-
class
Proxy
¶ Proxy class useful for situations when you wish to defer the initialization of an object. For instance, you want to define your models but you do not know what database engine you will be using until runtime.
Example:
database_proxy = Proxy() # Create a proxy for our db. class BaseModel(Model): class Meta: database = database_proxy # Use proxy for our DB. class User(BaseModel): username = CharField() # Based on configuration, use a different database. if app.config['DEBUG']: database = SqliteDatabase('local.db') elif app.config['TESTING']: database = SqliteDatabase(':memory:') else: database = PostgresqlDatabase('mega_production_db') # Configure our proxy to use the db we specified in config. database_proxy.initialize(database)
-
class
Node
¶ The
Node
class is the parent class for all composable parts of a query, and forms the basis of peewee’s expression API. The following classes extendNode
:SelectQuery
,UpdateQuery
,InsertQuery
,DeleteQuery
, andRawQuery
.Field
Func
(andfn()
)SQL
Expression
Param
Window
Clause
Entity
Check
Overridden operators:
- Bitwise and- and or- (
&
and|
): combine multiple nodes using the given conjunction. +
,-
,*
,/
and^
(add, subtract, multiply, divide and exclusive-or).==
,!=
,<
,<=
,>
,>=
: create a binary expression using the given comparator.<<
: create an IN expression.>>
: create an IS expression.%
and**
: LIKE and ILIKE.
-
contains
(rhs)¶ Create a binary expression using case-insensitive string search.
-
startswith
(rhs)¶ Create a binary expression using case-insensitive prefix search.
-
endswith
(rhs)¶ Create a binary expression using case-insensitive suffix search.
-
between
(low, high)¶ Create an expression that will match values between
low
andhigh
.
-
regexp
(expression)¶ Match based on regular expression.
-
concat
(rhs)¶ Concatenate the current node with the provided
rhs
.
-
is_null
([is_null=True])¶ Create an expression testing whether the
Node
is (or is not)NULL
.# Find all categories whose parent column is NULL. root_nodes = Category.select().where(Category.parent.is_null()) # Find all categores whose parent is NOT NULL. child_nodes = Category.select().where(Category.parent.is_null(False))
To simplify things, peewee will generate the correct SQL for equality and inequality. The
is_null()
method is provided simply for readability.# Equivalent to the previous queries -- peewee will translate these # into `IS NULL` and `IS NOT NULL`: root_nodes = Category.select().where(Category.parent == None) child_nodes = Category.select().where(Category.parent != None)
-
__invert__
()¶ Negate the node. This translates roughly into NOT (<node>).
-
alias
([name=None])¶ Apply an alias to the given node. This translates into <node> AS <name>.
-
asc
()¶ Apply ascending ordering to the given node. This translates into <node> ASC.
-
desc
()¶ Apply descending ordering to the given node. This translates into <node> DESC.
-
bind_to
(model_class)¶ Bind the results of an expression to a specific model type. Useful when adding expressions to a select, where the result of the expression should be placed on a particular joined instance.
-
classmethod
extend
([name=None[, clone=False]])¶ Decorator for adding the decorated function as a new method on
Node
and its subclasses. Useful for adding implementation-specific features to all node types.Parameters: - name (str) – Method name. If not provided the name of the wrapped function will be used.
- clone (bool) – Whether this method should return a clone. This is generally true when the method mutates the internal state of the node.
Example:
# Add a `cast()` method to all nodes using the '::' operator. PostgresqlDatabase.register_ops({'::', '::'}) @Node.extend() def cast(self, as_type): return Expression(self, '::', SQL(as_type)) # Let's pretend we want to find all data points whose numbers # are palindromes. Note that we can use the new *cast* method # on both fields and with the `fn` helper: reverse_val = fn.REVERSE(DataModel.value.cast('str')).cast('int') query = (DataPoint .select() .where(DataPoint.value == reverse_val))
Note
To remove an extended method, simply call
delattr
on the class the method was originally added to.


?UNIVERSIDAD
CENTRAL
DE
VENEZUELA
DEPTO.
DE
BOTANICA
Andira
inermis
(Wright)
DC.
ssp.
inermis
Det.:
Mary
Kalin
Arroyo
1975
HERBARIUM
No3-7
Family
Leguminosae
Scientific
Name
Andira
inermis
Common
Name
Angel
in
Locality
Tobago,
West
Indies
Habitat
important
large
tree,
common
throui>;hou
Collector
L.M.A.
Date
ĀMarch
13,
1963
-----
L.
M.
ANDREWS
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


I have been using DXM for about 5 yrs. now, and it is a wonderful experience. I also had some very weird times as well. Let me talk about the wonderful side of it first and the remarkable visions and trips, voyages, Free-falling like an airplane doing a nose dive and all the other stuff.
I always take it at night because during the day at that level everthing is flanged it is hard to walk. Not to mention when my brain suddenly gets scattered around the universe and then I have to stop (or it appeared) and gather each little piece up and put it back together, it gets a little hard to know where I'm going.
I would take 2 boxes of coricidin, wait about an hour then drink a bottle of Delsym. After and hour it kicks in then everything starts to become translucent like and I can sense and hear things at the same time. I am already a little physcic and when this happens I just get shot up (phsycicly) into the stratosphere. I mean I know what is on peoples mind and, it seems now, telling people what is going on when they do not have a clue themselves and wonder how the world I knew about it.
Then I go to dream. Colors galore. I am so out of it I see other rooms, places, worlds, alien environments, contact with other lifeforms-spiritual entites, And have amazing conversations with them.
I also witness some amazing animated cartoons. Let me describe one of them that I will never forget.
It all started out in/on the ground. A path. Two bullets where chasing a robber. The bullets where white and had points to their heads. Zipping along at REAL fast speeds. And the robber was always just out of their reach. He was gasping for breath because of all the running. Well, the bullets where chasing him for about (it seemed) 25 minutes and then suddenly ran into a stop (wwhich was nothing more than a high wall). Their was a big and loud BANG. The bullets obviosly killed the man they were after. The one bullet got up and said (and I heard this in realtime) 'Now where did he go' and the other bullet said 'I have absolutley NO idea' and they walked off the stage.
Another time I had a vision. It was like I was in front of a 101 inch TV about two feet away (now this is in technicolor and live action). I was wittnessing a crash in slow motion in a VERY busy side of a city. Their was this tanker-semi with alot of fuel in it turning the corner and this red small passenger car went smashing into it. And in slow motion the whole time I saw the explosion. The car went in the middle of the tanker-semi, it split in half, dumping all its fuel. Sparks were flying all around and ignited the fuel. Their was this GIGANTIC explosion and I saw it all in super slow motion.
These are the type of visions I have. Very realistic and like I am actually there wittnessing these events. But, every experience I have is differant, not one is the same.
Now I will tell about some VERY weird times I had on it. I drank 1 bottle of creomolsion and 1 bottle of delsym. I knew it was and OD but did it anyway. I didn't have alot of visions that night because Of the mind-body load, but the next morning I woke up and found, to my shock and total amazement, that the automatic part of my brain was completly knocked of and I had to assume manuel control. Now THAT is extremely hairy. I had my breathing go off the par too and had to manualy control that too, but that is another experience. I had to be very,very carful of how I thought. The slightest negative thought would shoot my heart rate up, my breathing would become impaired, panic attacks were common. I had to stay on top of that thin line just to keep myself normal.
After awile, I found that I could control every aspect of my autonomic nervous system. If I thought ny leg would cramp up, it would. My leg would start to tighten up and then I would release it and it would go back to normal. It was amazing and really interesting. I could call up the death sequence and I would feel Hell, halloween, and like a zombie at the same time. Also my heart would race and I would feel death start to sit in. Then I would reverse this and feel relaxed again. Now, all this was happening in my mind. I did not under any circumstances let any one know waht I was experiencing, It was a silent trip that lasted the whole day. It was truly amazing.
I have other experiences to talk about, but for know, I'll stop.
A word of warning: I built up my tolerance to this level over a period of five years and am so used to the effects and delusions and the VERY weird bodily perceptions that I am used to it and it does not bother me. If I had tried these doses initially I would probably have ended up in the hospital thinking I was dying, and in all likelyhood, I would have believed the hallucinations and delusions. This is an extremely powerful drug.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Welcome! I am a former entrepreneur turned developer who spent over four years in China at an education startup that I cofounded. Over the years, I've worked personally with over 300 students, and had the privilege of teaching some of the brightest students that continually emerge from China's burgeoning economy. Today, I am back home in the Bay Area, where I am a full-stack developer fluent in Rails and Node.js, with a not-so-closet love for Machine Learning and Data Analytics.
Who am I? This is still a question I'm still figuring out. Maybe one day when I'm rich and influential, I'll write a best-selling novel that'll dramatize this humble life of mine, but in the meantime, I'll stick with a few quirks for introductions.
I once lived in a buddhist monastry for 3 months during high school. It's based in Ukiah, and it's called "City of Ten Thousand Buddhas"
I fluently speak 3 dialects of Chinese. 4 years in China will do that to you.
Although my heritage is Chinese, my parents were born and raised in Vietnam. I also grew up in the Tenderloin, where there is a sizeable Vietnamese population, so I grew up eating Vietnamese food. It's still one of my favorite cuisines.
I was on the set of Amazing Spiderman (the one with Andrew Garfield). Random series of events led to me being chosen for a background role, and I was flown to New York (from LA) for a few days. If you pay attention to the lab scene right before Peter Parker gets bitten, you'll see me!
Lastly, my greatest petpeeve: Missing oxford comma.
Also, don't forget to check out my MEAN stack graffiti wall! Repo: Click here
A fully-functional full-stack Rails platform for prospective college students to share successful applications to better understand the admissions process. Incorporates HPE Haven On Demand API to score sentiment for submitted essays.
Github: https://github.com/supermikol/kanluqu |
Deployment: http://kanluqu.herokuapp.com
Human temperature collection system designed to warn public health officials of potential infectious disease outbreaks.
Github: https://github.com/WALTERKERR/TAP |
Deployment: http://thermo-aggregation-project.herokuapp.com
CRM dashboard for small and mid sized business owners to easily track data analytics of their financial transactions.
Github: https://github.com/supermikol/mortar-analytics |
Deployment: http://mortar-analytics.herokuapp.com
-Mark Twain


|
|---|
| Unto the angel of the church of Ephesus write; These things saith he that holdeth the seven stars in his right hand, who walketh in the midst of the seven golden candlesticks;
|
|---|
| ᎡᏈᏌ ᏧᎾᏁᎶᏗ ᎤᎾᏓᏡᎬ ᏗᎧᎿᎭᏩᏗᏙᎯ ᏫᏲᏪᎳᏏ ᎯᎠ ᎾᏍᎩ ᏫᏂᏪᏏ ᎠᏗᎭ ᎾᏍᎩ Ꮎ ᎦᎵᏉᎩ ᏃᏈᏏ ᎠᎦᏘᏏᏗᏢ ᎤᏬᏰᏂ ᏥᏚᏒᎦᎳ, ᎾᏍᎩ Ꮎ ᏤᏙᎭ ᎠᏰᎵ ᏕᎦᎧᎲ ᎦᎵᏉᎩ ᏗᏨᏙᏍᏗ ᏗᎦᎪᏙᏗᏱ ᎠᏕᎸ ᏓᎶᏂᎨ ᏗᎪᏢᏔᏅᎯ.
|
|---|
E-qui-sa tsu-na-ne-lo-di u-na-da-tlu-gv di-ka-hna-wa-di-do-hi wi-yo-we-la-si hi-a na-s-gi wi-ni-we-si a-di-ha na-s-gi na ga-li-quo-gi no-qui-si a-ga-ti-si-di-tlv u-wo-ye-ni tsi-du-sv-ga-la, na-s-gi na tse-do-ha a-ye-li de-ga-ka-hv ga-li-quo-gi di-tsv-do-s-di di-ga-go-do-di-yi a-de-lv da-lo-ni-ge di-go-tlv-ta-nv-hi.
|
|---|
|
|---|
| I know thy works, and thy labour, and thy patience, and how thou canst not bear them which are evil: and thou hast tried them which say they are apostles, and are not, and hast found them liars:
|
|---|
| ᏥᎦᏔᎭ ᏄᏍᏛ ᏕᏣᎸᏫᏍᏓᏁᎲᎢ, ᎠᎴ ᎯᎩᎵᏲᎬᎢ, ᎠᎴ ᎲᏂᏗᏳ ᎨᏒᎢ, ᎠᎴ ᎤᏁᎳᎩ ᏗᎦᎮᎵᏎᏗ ᏂᎨᏒᎾ ᎨᏒ ᎾᏍᎩ Ꮎ ᎤᏂᏲ ᏥᎩ; ᎠᎴ ᏘᎪᎵᏰᎥᎯ ᎢᎩ ᎾᏍᎩ ᎣᎩᏅᏏᏛ ᏣᎾᏗᎭ ᎾᏍᎩᏃ ᏄᏍᏛᎾ ᎨᏒᎢ, ᎠᎴ ᏣᏙᎴᎰᏒ ᎠᏂᏰᎪᎩ ᎨᏒᎢ;
|
|---|
Tsi-ga-ta-ha nu-s-dv de-tsa-lv-wi-s-da-ne-hv-i, a-le hi-gi-li-yo-gv-i, a-le hv-ni-di-yu ge-sv-i, a-le u-ne-la-gi di-ga-he-li-se-di ni-ge-sv-na ge-sv na-s-gi na u-ni-yo tsi-gi; a-le ti-go-li-ye-v-hi i-gi na-s-gi o-gi-nv-si-dv tsa-na-di-ha na-s-gi-no nu-s-dv-na ge-sv-i, a-le tsa-do-le-ho-sv a-ni-ye-go-gi ge-sv-i;
|
|---|
|
|---|
| And hast borne, and hast patience, and for my name's sake hast laboured, and hast not fainted.
|
|---|
| ᎠᎴ ᎤᏁᎳᎩ ᏤᎵᏎᏅ, ᎠᎴ ᎲᏂᏗᏳ ᎨᏒᎩ, ᎠᎴ ᏓᏆᏙᎥ ᏅᏧᎵᏍᏙᏔᏅ ᎯᎩᎵᏲᎬᎩ, ᎠᎴ ᎥᏝ ᏱᏗᏣᏯᏪᏤᎢ.
|
|---|
A-le u-ne-la-gi tse-li-se-nv, a-le hv-ni-di-yu ge-sv-gi, a-le da-qua-do-v nv-tsu-li-s-do-ta-nv hi-gi-li-yo-gv-gi, a-le v-tla yi-di-tsa-ya-we-tse-i.
|
|---|
|
|---|
| Nevertheless I have somewhat against thee, because thou hast left thy first love.
|
|---|
| ᎠᏎᏃ ᎪᎱᏍᏗ ᎢᎬᏰᎵᏎᎭ, ᏅᏗᎦᎵᏍᏙᏗᎭ ᎢᎬᏱᏱ ᏍᎩᎨᏳᎯᏳ ᏄᎵᏍᏔᏅ ᏕᏣᏲᏒᎢ.
|
|---|
A-se-no go-hu-s-di i-gv-ye-li-se-ha, nv-di-ga-li-s-do-di-ha i-gv-yi-yi s-gi-ge-yu-hi-yu nu-li-s-ta-nv de-tsa-yo-sv-i.
|
|---|
|
|---|
| Remember therefore from whence thou art fallen, and repent, and do the first works; or else I will come unto thee quickly, and will remove thy candlestick out of his place, except thou repent.
|
|---|
| ᎾᏍᎩ ᎢᏳᏍᏗ ᎭᏅᏓᏓ ᎾᎿᎭᏗᏣᎶᎠᏒᎢ, ᎠᎴ ᎯᏁᏟᏴᎾ ᏣᏓᏅᏛᎢ, ᎠᎴ ᎢᎬᏱᏱ ᏗᎦᎸᏫᏍᏓᏁᏗ ᎨᏒ ᏗᏣᎸᏫᏍᏓᏏ; ᎢᏳᏃ ᎾᏍᎩ ᏂᏣᏛᏁᎸᎾ ᎢᎨᏎᏍᏗ, ᏞᎩᏳ ᏓᎬᎷᏤᎵ, ᎠᎴ ᏓᏥᎧᎲᏏ ᎠᏨᏍᏙᏗ ᎦᎪᏙᏗ ᏣᏤᎵᎦ, ᎢᏳᏃ ᏂᏣᏁᏟᏴᏒᎾ ᎢᎨᏎᏍᏗ ᏣᏓᏅᏛᎢ.
|
|---|
Na-s-gi i-yu-s-di ha-nv-da-da na-hna di-tsa-lo-a-sv-i, a-le hi-ne-tli-yv-na tsa-da-nv-dv-i, a-le i-gv-yi-yi di-ga-lv-wi-s-da-ne-di ge-sv di-tsa-lv-wi-s-da-si; i-yu-no na-s-gi ni-tsa-dv-ne-lv-na i-ge-se-s-di, tle-gi-yu da-gv-lu-tse-li, a-le da-tsi-ka-hv-si a-tsv-s-do-di ga-go-do-di tsa-tse-li-ga, i-yu-no ni-tsa-ne-tli-yv-sv-na i-ge-se-s-di tsa-da-nv-dv-i.
|
|---|
|
|---|
| But this thou hast, that thou hatest the deeds of the Nicolaitans, which I also hate.
|
|---|
| ᎯᎠᏍᎩᏂᏃᏅ ᏂᎤᏍᏗ ᎢᏣᎭ, ᎾᏍᎩ ᎢᎯᏂᏆᏘᎭ ᏚᏂᎸᏫᏍᏓᏁᎲ ᎠᏂᏂᎦᎴᏓᏂ, ᎾᏍᎩ ᎾᏍᏉ ᎠᏴ ᏥᏥᏂᏆᏘᎭ.
|
|---|
Hi-a-s-gi-ni-no-nv ni-u-s-di i-tsa-ha, na-s-gi i-hi-ni-qua-ti-ha du-ni-lv-wi-s-da-ne-hv A-ni-ni-ga-le-da-ni, na-s-gi na-s-quo a-yv tsi-tsi-ni-qua-ti-ha.
|
|---|
|
|---|
| He that hath an ear, let him hear what the Spirit saith unto the churches; To him that overcometh will I give to eat of the tree of life, which is in the midst of the paradise of God.
|
|---|
| ᎩᎶ ᎦᎵᎷᎨᏍᏗ ᏩᏛᎬᎦ ᎠᏓᏅᏙ ᏂᏕᎦᏪᏎᎲ ᎫᎾᏁᎶᏗ ᏚᎾᏓᏡᏩᏗᏒᎢ; ᎩᎶ ᎠᏓᏎᎪᎩᏍᎨᏍᏗ ᏓᏥᏯᎵᏍᎪᎸᏓᏁᎵ ᎤᎵᏍᏓᏴᏙᏗᏱ ᎤᏓᏔᏅᎯ ᏡᎬ ᎬᏂᏛ ᎠᏓᏁᎯ, ᎾᏍᎩ ᎠᏰᎵ ᎤᏁᎳᏅᎯ ᎤᏤᎵ ᎠᏫᏒᏗᏱ ᏥᏡᎦ.
|
|---|
Gi-lo ga-li-lu-ge-s-di wa-dv-gv-ga A-da-nv-do ni-de-ga-we-se-hv gu-na-ne-lo-di du-na-da-tlu-wa-di-sv-i; gi-lo a-da-se-go-gi-s-ge-s-di da-tsi-ya-li-s-go-lv-da-ne-li u-li-s-da-yv-do-di-yi u-da-ta-nv-hi tlu-gv gv-ni-dv a-da-ne-hi, na-s-gi a-ye-li U-ne-la-nv-hi u-tse-li a-wi-sv-di-yi tsi-tlu-ga.
|
|---|
|
|---|
| And unto the angel of the church in Smyrna write; These things saith the first and the last, which was dead, and is alive;
|
|---|
| ᏑᎹᏂᏃ ᏧᎾᏁᎶᏗ ᎤᎾᏓᏡᎬ ᏗᎧᎿᎭᏩᏗᏙᎯ ᏫᏲᏪᎳᏏ; ᎯᎠ ᎾᏍᎩ ᏫᏂᏪᏏ ᎠᏗᎭ ᎾᏍᎩ Ꮎ ᎢᎬᏱᏱ ᎠᎴ ᎤᎵᏍᏆᎸᏗ, ᎾᏍᎩ Ꮎ ᎤᏲᎱᏒᎯ ᏥᎨᏒ ᎠᎴ ᎾᏍᎩ ᏤᎭ.
|
|---|
Su-ma-ni-no tsu-na-ne-lo-di u-na-da-tlu-gv di-ka-hna-wa-di-do-hi wi-yo-we-la-si; hi-a na-s-gi wi-ni-we-si a-di-ha na-s-gi na i-gv-yi-yi a-le u-li-s-qua-lv-di, na-s-gi na u-yo-hu-sv-hi tsi-ge-sv a-le na-s-gi tse-ha.
|
|---|
|
|---|
| I know thy works, and tribulation, and poverty, (but thou art rich) and I know the blasphemy of them which say they are Jews, and are not, but are the synagogue of Satan.
|
|---|
| ᏥᎦᏔᎭ ᏄᏍᏛ ᏕᏣᎸᏫᏍᏓᏁᎲᎢ, ᎠᎴ ᎤᏕᏯᏙᏗ ᏂᏣᎵᏍᏓᏁᎲᎢ, ᎠᎴ ᎤᏲ ᏂᏣᏛᎿᎭᏕᎬᎢ,^ᎠᏎᏃ ᏤᎿᎭᎢᏳ. ᎠᎴ ᏥᎦᏔᎭ ᎾᏍᎩ ᎤᏂᏐᏢᎢᏍᏙᏗ ᎨᏒ ᎣᏥᏧᏏ ᎠᎾᏗᏍᎩ, ᎾᏍᎩᏃ ᏄᏍᏛᎾ ᏥᎩ, ᏎᏓᏂᏉᏍᎩᏂ ᎤᏤᎵ ᏗᎦᎳᏫᎢᏍᏗᏱ ᎠᏁᎳ ᏥᎩ.
|
|---|
Tsi-ga-ta-ha nu-s-dv de-tsa-lv-wi-s-da-ne-hv-i, a-le u-de-ya-do-di ni-tsa-li-s-da-ne-hv-i, a-le u-yo ni-tsa-dv-hna-de-gv-i,^a-se-no tse-hna-i-yu. A-le tsi-ga-ta-ha na-s-gi u-ni-so-tlv-i-s-do-di ge-sv O-tsi-tsu-si a-na-di-s-gi, na-s-gi-no nu-s-dv-na tsi-gi, Se-da-ni-quo-s-gi-ni u-tse-li di-ga-la-wi-i-s-di-yi a-ne-la tsi-gi.
|
|---|
|
|---|
| Fear none of those things which thou shalt suffer: behold, the devil shall cast some of you into prison, that ye may be tried; and ye shall have tribulation ten days: be thou faithful unto death, and I will give thee a crown of life.
|
|---|
| ᏞᏍᏗ ᏣᏍᎦᎸᎩ ᎾᏍᎩ Ꮎ ᏧᏓᎴᏅᏛ ᏣᎩᎵᏲᎢᏍᏗ ᏥᎩ; ᎬᏂᏳᏉ ᎠᏍᎩᎾ ᏂᎯ ᎢᏣᏓᏡᎬ ᎩᎶ ᏗᏓᏍᏚᏗᏱ ᏙᏓᏥᏴᏔᏂ ᎡᏥᎪᎵᏰᏗᏱ; ᎠᏍᎪᎯᏃ ᏧᏒᎯᏛ ᏓᏥᎩᎵᏲᏥ; ᎤᎵᏂᎩᏛ ᏘᎧᎿᎭᏩᏚᎦ ᎠᏲᎱᎯᏍᏗ ᎨᏒ ᎬᏗᏍᎩ, ᎠᎵᏍᏚᎶᏃ ᎬᏂᏛ ᎠᏓᏁᎯ ᏓᎬᏅᏁᎵ.
|
|---|
Tle-s-di tsa-s-ga-lv-gi na-s-gi na tsu-da-le-nv-dv tsa-gi-li-yo-i-s-di tsi-gi; gv-ni-yu-quo a-s-gi-na ni-hi i-tsa-da-tlu-gv gi-lo di-da-s-du-di-yi do-da-tsi-yv-ta-ni e-tsi-go-li-ye-di-yi; a-s-go-hi-no tsu-sv-hi-dv da-tsi-gi-li-yo-tsi; u-li-ni-gi-dv ti-ka-hna-wa-du-ga a-yo-hu-hi-s-di ge-sv gv-di-s-gi, a-li-s-du-lo-no gv-ni-dv a-da-ne-hi da-gv-nv-ne-li.
|
|---|
|
|---|
| He that hath an ear, let him hear what the Spirit saith unto the churches; He that overcometh shall not be hurt of the second death.
|
|---|
| ᎩᎶ ᎦᎵᎷᎨᏍᏗ, ᏩᏛᎬᎦ ᎠᏓᏅᏙ ᏂᏕᎦᏪᏎᎲ ᏧᎾᏁᎶᏗ ᏚᎾᏓᏡᏩᏗᏒᎢ; ᎩᎶ ᎠᏓᏎᎪᎩᏍᎨᏍᏗ ᏔᎵᏁ ᎠᏲᎱᎯᏍᏗ ᎨᏒ ᎥᏝ ᎪᎱᏍᏗ ᎤᏩᏁᏗ ᏱᎨᏎᏍᏗ.
|
|---|
Gi-lo ga-li-lu-ge-s-di, wa-dv-gv-ga A-da-nv-do ni-de-ga-we-se-hv tsu-na-ne-lo-di du-na-da-tlu-wa-di-sv-i; gi-lo a-da-se-go-gi-s-ge-s-di ta-li-ne a-yo-hu-hi-s-di ge-sv v-tla go-hu-s-di u-wa-ne-di yi-ge-se-s-di.
|
|---|
|
|---|
| And to the angel of the church in Pergamos write; These things saith he which hath the sharp sword with two edges;
|
|---|
| ᏆᎦᎹᏃ ᏧᎾᏁᎶᏗ ᎤᎾᏓᏡᎬ ᏗᎧᎿᎭᏩᏗᏙᎯ ᏫᏲᏪᎳᏏ, ᎯᎠ ᎾᏍᎩ ᏫᏂᏪᏏ ᎠᏗᎭ ᎾᏍᎩ Ꮎ ᎠᏰᎳᏍᏗ-ᎦᏅᎯᏛ ᎢᏧᎳᏗᏢ ᏗᎪᏍᏓᏯ ᏥᎦᏁᎭ.
|
|---|
Qua-ga-ma-no tsu-na-ne-lo-di u-na-da-tlu-gv di-ka-hna-wa-di-do-hi wi-yo-we-la-si, hi-a na-s-gi wi-ni-we-si a-di-ha na-s-gi na a-ye-la-s-di--ga-nv-hi-dv i-tsu-la-di-tlv di-go-s-da-ya tsi-ga-ne-ha.
|
|---|
|
|---|
| I know thy works, and where thou dwellest, even where Satan's seat is: and thou holdest fast my name, and hast not denied my faith, even in those days wherein Antipas was my faithful martyr, who was slain among you, where Satan dwelleth.
|
|---|
| ᏥᎦᏔᎭ ᏄᏍᏛ ᏕᏣᎸᏫᏍᏓᏁᎲᎢ, ᎠᎴ ᎾᎿᎭᎮᎲᎢ, ᎾᎿᎭᏎᏓᏂ ᎤᏪᏘᏱ ᎨᏒᎢ; ᎠᎴ ᎾᏍᎩ ᎠᏍᏓᏱᏳ ᏕᏣᏂᏴᏒ ᏓᏆᏙᎥᎢ, ᎠᎴ ᏂᏣᏓᏱᎸᎾ ᎨᏒ ᎠᏆᏤᎵ ᎪᎯᏳᏗ ᎨᏒᎢ, ᎾᎯᏳᎢ ᎥᏗᏆᏏ ᎤᏓᎵᏓᏍᏗ ᏂᎨᏒᎾ ᎠᎩᏃᎮᏍᎩ ᏄᎵᏍᏔᏅ, ᎾᏍᎩ ᏂᎯ ᎢᏤᎲ ᏣᏥᎸᎩ, ᎾᎿᎭᏎᏓᏂ ᏒᎲᎢ.
|
|---|
Tsi-ga-ta-ha nu-s-dv de-tsa-lv-wi-s-da-ne-hv-i, a-le na-hna he-hv-i, na-hna Se-da-ni u-we-ti-yi ge-sv-i; a-le na-s-gi a-s-da-yi-yu de-tsa-ni-yv-sv da-qua-do-v-i, a-le ni-tsa-da-yi-lv-na ge-sv a-qua-tse-li go-hi-yu-di ge-sv-i, na-hi-yu-i V-di-qua-si u-da-li-da-s-di ni-ge-sv-na a-gi-no-he-s-gi nu-li-s-ta-nv, na-s-gi ni-hi i-tse-hv tsa-tsi-lv-gi, na-hna Se-da-ni sv-hv-i.
|
|---|
|
|---|
| But I have a few things against thee, because thou hast there them that hold the doctrine of Balaam, who taught Balac to cast a stumblingblock before the children of Israel, to eat things sacrificed unto idols, and to commit fornication.
|
|---|
| ᎠᏎᏃ ᎢᎸᏍᎩ ᎢᏳᏓᎴᎩ ᎡᏍᎦ ᎬᏰᎸᎾᎲ ᎢᎩ, ᏅᏗᎦᎵᏍᏙᏗᎭ ᎾᎿᎭᏕᏣᎧᎲ ᏇᎳᎻ ᏓᏕᏲᎲᏍᎬ ᏧᏂᏂᏴᎯ, ᎾᏍᎩ Ꮎ ᏇᎳᎻ ᏇᎳᎩ ᏧᏪᏲᏁ ᎢᎬᏱᏗᏢ ᏧᏁᏗᏱ ᏧᏃᏕᎯᎯ ᎢᏏᎵ ᏧᏪᏥ, ᎾᏍᎩ ᎤᏂᎩᏍᏗᏱ ᎤᏁᎳᏅᎯ ᏗᏰᎸᎯ ᏗᎵᏍᎪᎸᏓᏁᎸᎯ, ᎠᎴ ᎤᏕᎵᏛ ᏧᎾᏂᏏᏗᏱ.
|
|---|
A-se-no i-lv-s-gi i-yu-da-le-gi e-s-ga gv-ye-lv-na-hv i-gi, nv-di-ga-li-s-do-di-ha na-hna de-tsa-ka-hv Que-la-mi da-de-yo-hv-s-gv tsu-ni-ni-yv-hi, na-s-gi na Que-la-mi Que-la-gi tsu-we-yo-ne i-gv-yi-di-tlv tsu-ne-di-yi tsu-no-de-hi-hi I-si-li tsu-we-tsi, na-s-gi u-ni-gi-s-di-yi U-ne-la-nv-hi di-ye-lv-hi di-li-s-go-lv-da-ne-lv-hi, a-le u-de-li-dv tsu-na-ni-si-di-yi.
|
|---|
|
|---|
| So hast thou also them that hold the doctrine of the Nicolaitans, which thing I hate.
|
|---|
| ᎠᎴ ᎾᏍᏉ ᏙᏣᎧᎭ ᎾᏍᎩ Ꮎ ᏧᏂᏂᏴᎯ ᏓᎾᏕᏲᎲᏍᎬ ᎠᏂᏂᎦᎴᏓᏂ, ᎾᏍᎩ ᎠᏴ ᏥᏥᏂᏆᏘᎭ.
|
|---|
a-le na-s-quo do-tsa-ka-ha na-s-gi na tsu-ni-ni-yv-hi da-na-de-yo-hv-s-gv A-ni-ni-ga-le-da-ni, na-s-gi a-yv tsi-tsi-ni-qua-ti-ha.
|
|---|
|
|---|
| Repent; or else I will come unto thee quickly, and will fight against them with the sword of my mouth.
|
|---|
| ᎯᏁᏟᏴᎾ ᏣᏓᏅᏛᎢ; ᎢᏳᏃ ᎾᏍᎩ ᏂᏣᏛᏁᎸᎾ ᎢᎨᏎᏍᏗ ᏞᎩᏳ ᏓᎬᎷᏤᎵ, ᎠᎴ ᏙᏓᎬᏯᏟᏴᎡᎵ ᎠᏰᎳᏍᏗᎦᏅᎯᏛ ᎬᏗ ᏥᎰᎵ ᎤᎦᏌᏛᎢ.
|
|---|
Hi-ne-tli-yv-na tsa-da-nv-dv-i; i-yu-no na-s-gi ni-tsa-dv-ne-lv-na i-ge-se-s-di tle-gi-yu da-gv-lu-tse-li, a-le do-da-gv-ya-tli-yv-e-li a-ye-la-s-di-ga-nv-hi-dv gv-di tsi-ho-li u-ga-sa-dv-i.
|
|---|
|
|---|
| He that hath an ear, let him hear what the Spirit saith unto the churches; To him that overcometh will I give to eat of the hidden manna, and will give him a white stone, and in the stone a new name written, which no man knoweth saving he that receiveth it.
|
|---|
| ᎩᎶ ᎦᎵᎷᎨᏍᏗ ᏩᏛᎬᎦ ᎠᏓᏅᏙ ᏂᏕᎦᏪᏎᎲ ᏧᎾᏁᎶᏗ ᏚᎾᏓᏡᏩᏗᏒᎢ; ᎩᎶ ᎠᏓᏎᎪᎩᏍᎨᏍᏗ ᏓᏥᏁᎵ ᎤᎵᏍᏓᏴᏙᏗ ᎬᏍᎦᎳᏅᎯ ᎹᎾ, ᎠᎴ ᎤᏁᎬ ᏅᏯ ᏓᏥᏁᎵ, ᎠᎴ ᏅᏲᎯ ᎪᏪᎴᏍᏗ ᎢᏤ ᏧᏙᏍᏙᏗ, ᎾᏍᎩ ᎩᎶ ᎾᎦᏔᎲᎾ Ꮎ ᏅᏯ ᎠᏥᏁᎸᎯ ᎤᏩᏒ.
|
|---|
Gi-lo ga-li-lu-ge-s-di wa-dv-gv-ga A-da-nv-do ni-de-ga-we-se-hv tsu-na-ne-lo-di du-na-da-tlu-wa-di-sv-i; gi-lo a-da-se-go-gi-s-ge-s-di da-tsi-ne-li u-li-s-da-yv-do-di gv-s-ga-la-nv-hi ma-na, a-le u-ne-gv nv-ya da-tsi-ne-li, a-le nv-yo-hi go-we-le-s-di i-tse tsu-do-s-do-di, na-s-gi gi-lo na-ga-ta-hv-na na nv-ya a-tsi-ne-lv-hi u-wa-sv.
|
|---|
|
|---|
| And unto the angel of the church in Thyatira write; These things saith the Son of God, who hath his eyes like unto a flame of fire, and his feet are like fine brass;
|
|---|
| ᏓᏱᏓᎵᏃ ᎤᎾᏓᏡᎬ ᏧᎾᏁᎶᏗ ᏗᎧᎿᎭᏩᏗᏙᎯ ᏫᏲᏪᎳᏏ; ᎯᎠ ᎾᏍᎩ ᏫᏂᏪᏏ ᎠᏗᎭ ᎤᏁᎳᏅᎯ ᎤᏪᏥ, ᎾᏍᎩ Ꮎ ᏗᎦᏙᎵ ᎠᏥᎸ ᎠᏓᏪᎵᎩᏍᎩ ᎾᏍᎩᏯ ᏥᎩ, ᏧᎳᏏᏕᏂᏃ ᎥᏣᏱ ᎬᏩᏔᎷᎩᏍᎩ ᎾᏍᎩᏯ ᏥᎩ;
|
|---|
Da-yi-da-li-no u-na-da-tlu-gv tsu-na-ne-lo-di di-ka-hna-wa-di-do-hi wi-yo-we-la-si; Hi-a na-s-gi wi-ni-we-si a-di-ha U-ne-la-nv-hi U-we-tsi, na-s-gi na di-ga-do-li a-tsi-lv a-da-we-li-gi-s-gi na-s-gi-ya tsi-gi, tsu-la-si-de-ni-no v-tsa-yi gv-wa-ta-lu-gi-s-gi na-s-gi-ya tsi-gi;
|
|---|
|
|---|
| I know thy works, and charity, and service, and faith, and thy patience, and thy works; and the last to be more than the first.
|
|---|
| ᏥᎦᏔᎭ ᏄᏍᏛ ᏕᏣᎸᏫᏍᏓᏁᎲᎢ, ᎠᎴ ᏣᏓᎨᏳᏒᎢ, ᎠᎴ ᏕᎭᏓᏁᎳᏁᎲᎢ, ᎠᎴ ᏦᎯᏳᏒᎢ, ᎠᎴ ᎲᏂᏗᏳ ᎨᏒᎢ, ᎠᎴ ᏄᏍᏛ ᏕᏣᎸᏫᏍᏓᏁᎲᎢ; ᎤᎵᏍᏆᎸᏗᏃ ᎤᏟ ᎢᎦᎢ ᎨᏒ ᎡᏍᎦᏉ ᎢᎬᏱᏱ.
|
|---|
Tsi-ga-ta-ha nu-s-dv de-tsa-lv-wi-s-da-ne-hv-i, a-le tsa-da-ge-yu-sv-i, a-le de-ha-da-ne-la-ne-hv-i, a-le tso-hi-yu-sv-i, a-le hv-ni-di-yu ge-sv-i, a-le nu-s-dv de-tsa-lv-wi-s-da-ne-hv-i; u-li-s-qua-lv-di-no u-tli i-ga-i ge-sv e-s-ga-quo i-gv-yi-yi.
|
|---|
|
|---|
| Notwithstanding I have a few things against thee, because thou sufferest that woman Jezebel, which calleth herself a prophetess, to teach and to seduce my servants to commit fornication, and to eat things sacrificed unto idols.
|
|---|
| ᎠᏎᏃ ᎢᎸᏍᎩ ᎢᏳᏓᎴᎩ ᎪᎱᏍᏗ ᎡᏍᎦ ᎬᏰᎸᎾᏁᎲ ᎢᎩ, ᏅᏗᎦᎵᏍᏙᏗᎭ ᎤᏁᎳᎩ ᏥᏰᎵᏎᎭ Ꮎ ᎠᎨᏴ ᏤᏏᏈᎵ, ᎦᏙᎴᎣᏍᎩ ᎠᏴ ᏣᏗᎭ, ᏧᏪᏲᏗᏱ ᎠᎴ ᏧᎶᏄᎮᏗᏱ ᎾᏍᎩ ᎢᏳᏩᏂᏐᏗᏱ ᎤᏕᎴᏛ ᏧᎾᏂᏏᏗᏱ ᏗᏆᏤᎵ ᎦᏥᏅᏏᏛ, ᎠᎴ ᎤᏂᎩᏍᏗᏱ ᎤᏁᎳᏅᎯ ᏗᏰᎸᎯ ᏗᎵᏍᎪᎸᏓᏁᎸᎯ.
|
|---|
A-se-no i-lv-s-gi i-yu-da-le-gi go-hu-s-di e-s-ga gv-ye-lv-na-ne-hv i-gi, nv-di-ga-li-s-do-di-ha u-ne-la-gi tsi-ye-li-se-ha na a-ge-yv Tse-si-qui-li, ga-do-le-o-s-gi a-yv tsa-di-ha, tsu-we-yo-di-yi a-le tsu-lo-nu-he-di-yi na-s-gi i-yu-wa-ni-so-di-yi u-de-le-dv tsu-na-ni-si-di-yi di-qua-tse-li ga-tsi-nv-si-dv, a-le u-ni-gi-s-di-yi U-ne-la-nv-hi di-ye-lv-hi di-li-s-go-lv-da-ne-lv-hi.
|
|---|
|
|---|
| And I gave her space to repent of her fornication; and she repented not.
|
|---|
| ᎠᎴ ᏥᎳᏅᏓᏕᎸᎩ ᎤᏲ ᎤᏰᎸᏗᏱ ᎤᏕᎵᏛ ᏚᏂᏏᏂᏙᎸᎢ; ᎠᏎᏃ ᎥᏝ ᎤᏲ ᏳᏰᎸᏁᎢ.
|
|---|
A-le tsi-la-nv-da-de-lv-gi u-yo u-ye-lv-di-yi u-de-li-dv du-ni-si-ni-do-lv-i; a-se-no v-tla u-yo yu-ye-lv-ne-i.
|
|---|
|
|---|
| Behold, I will cast her into a bed, and them that commit adultery with her into great tribulation, except they repent of their deeds.
|
|---|
| ᎬᏂᏳᏉ ᎠᏤᏍᏙᎩᎯ ᏮᏓᏥᏯᏓᎡᏏ, ᎠᎴ ᎾᏍᎩ ᎤᏕᎵᏛ ᏗᎾᏂᏏᎲᏍᎩ ᎤᏣᏘ ᏓᎦᏥᏯᏕᏯᏙᏔᏂ ᎢᏳᏃ ᎤᏲ ᏄᏂᏁᏟᏴᏛ ᎢᎨᏎᏍᏗ ᏚᏂᎸᏫᏍᏓᏁᎲᎢ.
|
|---|
Gv-ni-yu-quo a-tse-s-do-gi-hi wv-da-tsi-ya-da-e-si, a-le na-s-gi u-de-li-dv di-na-ni-si-hv-s-gi u-tsa-ti da-ga-tsi-ya-de-ya-do-ta-ni i-yu-no u-yo nu-ni-ne-tli-yv-dv i-ge-se-s-di du-ni-lv-wi-s-da-ne-hv-i.
|
|---|
|
|---|
| And I will kill her children with death; and all the churches shall know that I am he which searcheth the reins and hearts: and I will give unto every one of you according to your works.
|
|---|
| ᏧᏪᏥᏃ ᎠᏲᎱᎯᏍᏗ ᎨᏒ ᏙᏓᎦᏥᎢᏍᏔᏂ; ᏂᎦᏗᏳᏃ ᏓᎾᏁᎶᏗ ᏚᎾᏓᏡᏩᏗᏒ ᎠᏂᎦᏔᎮᏍᏗ ᎾᏍᎩ ᎠᏴ ᏗᏥᎪᎵᏰᏍᎩ ᎨᏒ ᎤᏕᎵᏛ ᎨᏒ ᎠᎴ ᏧᏂᎾᏫ; ᎠᎴ ᏓᏨᏁᎵ ᏂᏥᎥ ᎢᏥᏏᏴᏫᎭ ᎨᏒ ᎾᏍᎩᏯ ᏄᏍᏛ ᏕᏥᎸᏫᏍᏓᏁᎸᎢ.
|
|---|
Tsu-we-tsi-no a-yo-hu-hi-s-di ge-sv do-da-ga-tsi-i-s-ta-ni; ni-ga-di-yu-no da-na-ne-lo-di du-na-da-tlu-wa-di-sv a-ni-ga-ta-he-s-di na-s-gi a-yv di-tsi-go-li-ye-s-gi ge-sv u-de-li-dv ge-sv a-le tsu-ni-na-wi; a-le da-tsv-ne-li ni-tsi-v i-tsi-si-yv-wi-ha ge-sv na-s-gi-ya nu-s-dv de-tsi-lv-wi-s-da-ne-lv-i.
|
|---|
|
|---|
| But unto you I say, and unto the rest in Thyatira, as many as have not this doctrine, and which have not known the depths of Satan, as they speak; I will put upon you none other burden.
|
|---|
| ᏂᎯᏍᎩᏂ ᎢᏨᏲᏎᎭ, ᎠᎴ ᎠᏂᏐᎢ ᏓᏱᏓᎵ ᎠᏁᎯ, ᎾᏍᎩ ᎾᏂᎥ ᎯᎠ ᏗᏕᏲᏗ ᎨᏒ ᏄᏂᎲᎾ, ᎠᎴ ᎾᏍᎩ ᏄᏂᎦᏙᎥᏒᎾ ᎾᎭᏫᏂᏴ ᏎᏓᏂ ᎤᏤᎵᎦ, ᏣᎾᏗᎭ; ᎥᏝ ᏅᏩᏓᎴ ᎦᎨᏛ ᏴᎨᏨᏐᏈᎸᎦ;
|
|---|
Ni-hi-s-gi-ni i-tsv-yo-se-ha, a-le a-ni-so-i Da-yi-da-li a-ne-hi, Na-s-gi na-ni-v hi-a di-de-yo-di ge-sv nu-ni-hv-na, a-le na-s-gi nu-ni-ga-do-v-sv-na na-ha-wi-ni-yv Se-da-ni u-tse-li-ga, tsa-na-di-ha; v-tla nv-wa-da-le ga-ge-dv yv-ge-tsv-so-qui-lv-ga;
|
|---|
|
|---|
| But that which ye have already hold fast till I come.
|
|---|
| ᎾᏍᎩᏍᎩᏂ Ꮎ ᎦᏳᎳ ᏥᏥᎭ ᏕᏥᏂᏴᏎᏍᏗ ᎬᏂ ᎢᏥᎷᏨᎭ.
|
|---|
Na-s-gi-s-gi-ni na ga-yu-la tsi-tsi-ha de-tsi-ni-yv-se-s-di gv-ni i-tsi-lu-tsv-ha.
|
|---|
|
|---|
| And he that overcometh, and keepeth my works unto the end, to him will I give power over the nations:
|
|---|
| ᎩᎶᏍᎩᏂ ᎠᏓᏎᎪᎩᏍᎨᏍᏗ ᎠᎴ ᎠᏍᏆᏂᎪᏗᏍᎨᏍᏗ ᎠᏆᏤᎵ ᏗᎦᎸᏫᏍᏓᏁᏗ ᎨᏒ ᎬᎵᏍᏆᏗᏍᎩ, ᎾᏍᎩ ᏓᏥᏁᎵ ᏧᏎᎪᎩᏍᏗᏱ ᏧᎾᏓᎴᏅᏛ ᏴᏫ.
|
|---|
Gi-lo-s-gi-ni a-da-se-go-gi-s-ge-s-di a-le a-s-qua-ni-go-di-s-ge-s-di a-qua-tse-li di-ga-lv-wi-s-da-ne-di ge-sv gv-li-s-qua-di-s-gi, na-s-gi da-tsi-ne-li tsu-se-go-gi-s-di-yi tsu-na-da-le-nv-dv yv-wi.
|
|---|
|
|---|
| And he shall rule them with a rod of iron; as the vessels of a potter shall they be broken to shivers: even as I received of my Father.
|
|---|
| ᎠᎴ ᎾᏍᎩ ᏙᏛᏘᏂᏙᎵ ᎠᏙᎳᏅᏍᏗ ᏔᎷᎩᏍᎩ ᎪᏢᎳᏅᎯ ᏓᎬᏔᏂ; ᎠᎴ ᏗᏩᎵ ᏥᏕᎦᏓᏬᏗᏍᎪᎢ ᎾᏍᎩᏯ ᏙᏓᎦᏓᏬᏔᏂ; ᎾᏍᎩᏯ ᏓᎩᏲᎯᏎᎸ ᎡᏙᏓ.
|
|---|
A-le na-s-gi do-dv-ti-ni-do-li a-do-la-nv-s-di ta-lu-gi-s-gi go-tlv-la-nv-hi da-gv-ta-ni; a-le di-wa-li tsi-de-ga-da-wo-di-s-go-i na-s-gi-ya do-da-ga-da-wo-ta-ni; na-s-gi-ya da-gi-yo-hi-se-lv E-do-da.
|
|---|
|
|---|
| And I will give him the morning star.
|
|---|
| ᎠᎴ ᎾᏍᎩ Ꮎ ᏓᏥᏁᎵ ᏑᎾᎴ ᎡᎯᏃᏈᏏ.
|
|---|
A-le na-s-gi na da-tsi-ne-li su-na-le e-hi-no-qui-si.
|
|---|
|
|---|
| He that hath an ear, let him hear what the Spirit saith unto the churches.
|
|---|
| ᎩᎶ ᎦᎵᎷᎨᏍᏗ ᏩᏛᎬᎦ ᎠᏓᏅᏙ ᏂᏕᎦᏪᏎᎲ ᏧᎾᏁᎶᏗ ᏚᎾᏓᏡᏩᏗᏒᎢ.
|
|---|
Gi-lo ga-li-lu-ge-s-di wa-dv-gv-ga A-da-nv-do ni-de-ga-we-se-hv tsu-na-ne-lo-di du-na-da-tlu-wa-di-sv-i.
|
|---|


Stefanos Tsitsipas beats Roger Federer in ATP semi-final
by GCTCongratulations to Stefanos Tsitsipas who will contest his first ever final in London after beating Roger Federer 6-3, 6-4 in the ATP semi-final.
After the game, the 21-year-old stated “Wow! Jesus. I’m so proud of myself today. Great performance and once again, people were great. I really enjoyed my time on the court and sometimes matches like this, you wonder to yourself how you overcome all those difficulties, all those break points down. It’s really, like, a mental struggle. So I’m really proud that I managed to save so many break points today. You know, I was trying not to give an easy time to Roger. He was playing good and shout out to him as well. He did pretty well this week in Nitto. I mean, an inspration, obviously, as always. Playing him, it’s the biggest honour I could have. Today’s win, victory is probably one of my best matches of this season. And these are the moments that I always wait for and these are the moments that I want to prove the best out of my game.”


WITNESS LIST State Affairs Committee April 2, 2001 - 1:00P SB 497 Registering, but not testifying: For: Schneider, Michael (Texas Association of Broadcasters), Austin, TX On: Neal, Don (Texas State Comptroller), Austin, TX SB 608 FOR: Borofsky, Cliff (Bexar County), San Antonio, TX Registering, but not testifying: For: Mitchell, Seth (Bexar County), San Antonio, TX SB 796 FOR: Bacon, April (Travis County Auditor's Office), Austin, TX Porter, Virginia (Dallas County Auditor), Dallas, TX Spataro, Susan (Self/Travis County Auditor's Office), Austin, TX Tompkins, Tommy (Texas Association of County Auditors), Houston, TX ON: Mitchell, Kathy (Consumers Union), Austin, TX Woodford, Suzy (Common Cause Texas), Austin, TX Registering, but not testifying: For: Allison, Jim (County Judge's & Commissioner's Association of Texas), Austin, TX Backus, David (Texas Association of School Administrators), Austin, TX Douglass, Cathy (Texas Association of School Boards), Austin, TX Against: Schneider, Michael (Texas Association of Broadcasters), Austin, TX Whalen, Ken (Texas Daily Newspaper Association/Texas Press Association), Austin, TX On: Brown, Doug (State Auditor's Office), Austin, TX Jungerman, David (Travis County Auditor's Office), Austin, TX SB 817 Registering, but not testifying: On: Pitcock, Michael G. (Texas Lottery Commission), Austin, TX SB 971 Registering, but not testifying: For: Woodford, Suzy (Common Cause Texas), Austin, TX On: Arnold, Stephen (Southwestern Capital Markets), San Antonio, TX SB 1020 FOR: Lindsey, Gary (Dallas County Sheriff-Jim Bowles), Dallas, TX ON: Lopez, Carlos (TxDOT), Austin, TX Registering, but not testifying: For: Denholm, John (Tommy Thomas, Sheriff of Harris County), Houston, TX Igo, Shanna (Texas Municipal League), Austin, TX McCarley, James (Dallas Regional Mobility Coalition), Dallas, TX Watson, Rick (Chief of Police, Terrell Bolton, Dallas Police Department), Dallas, TX Ybarbo, Ray (Chief of Police, Al Philippus, San Antonio Police Department), San Antonio, TX Zacharias, Larry (City of Richardson/Texas Police Chiefs Association), Richardson, TX SB 1023 ON: Borofsky, Cliff (Bexar County), San Antonio, TX Registering, but not testifying: On: McGeehan, Ann (Secretary of State), Austin, TX SB 1115 Registering, but not testifying: For: Fairbrother, Paul (Nortel Networks), Austin, TX Smith, Patrick (Quest), Austin, TX Woodford, Suzy (Common Cause Texas), Austin, TX On: Purcell, Carolyn (Department of Information Resources), Austin, TX SB 1161 Registering, but not testifying: For: Gilliam, Thane (Self), Port Aransas, TX SB 1182 FOR: Baggett, Donnis (Texas Daily Newpaper Association/Texas Press Association), Austin, TX Mitchell, Kathy (Consumers Union), Austin, TX Woodford, Suzy (Common Cause Texas), Austin, TX Zion, Mark (Texas Public Power Association), Austin, TX ON: Cary, Katherine (Office of Attorney General), Austin, TX Douglass, Cathy (Texas Association of School Boards), Austin, TX Horton, Susan (Texas Municipal League), Austin, TX Registering, but not testifying: For: Schneider, Michael (Texas Association of Broadcasters), Austin, TX SB 1404 FOR: Fenner, John (New Mexico Department of Transportation), Santa Fe, NM AGAINST: Burnett, William (J.D. Abrams, L.P./AGC of Texas), Austin, TX Weisman, John R. (AGC of Texas), Austin, TX ON: Behrens, Mike (TxDOT), Austin, TX Heald, Wes (TxDOT), Austin, TX Registering, but not testifying: For: Igo, Shanna (Texas Municipal League), Austin, TX SB 1424 FOR: Patterson, Jerry (Texas Coalition of Veterans Organizations), Austin, TX SB 1439 FOR: Robinson, Councilman Carroll (City of Houston), Houston, TX AGAINST: Eckels, Judge Robert (Self), Houston, TX SB 1440 FOR: Robinson, Councilman Carroll (City of Houston), Houston, TX AGAINST: Eckels, Judge Robert (Self), Houston, TX SB 1464 FOR: McGrath, Judge Bob (342nd District), Fort Worth, TX ON: McGeehan, Ann (Secretary of State), Austin, TX SB 1491 Registering, but not testifying: On: McGeehan, Ann (Secretary of State), Austin, TX SB 1529 ON: Cuellar, Henry (Secretary of State), Austin, TX Registering, but not testifying: For: Woodford, Suzy (Common Cause Texas), Austin, TX On: McGeehan, Ann (Secretary of State), Austin, TX