Skip to content

Commit

Permalink
fix: remove unused use_speedup property
Browse files Browse the repository at this point in the history
  • Loading branch information
F1int0m authored and kalombos committed May 2, 2024
1 parent 797910d commit b54abbf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 50 deletions.
24 changes: 0 additions & 24 deletions peewee_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,14 +855,6 @@ def init(self, database, **kwargs):
super().init(database, **kwargs)
self.init_async()

@property
def use_speedups(self):
return False

@use_speedups.setter
def use_speedups(self, value):
pass


register_database(PostgresqlDatabase, 'postgres+async', 'postgresql+async')

Expand Down Expand Up @@ -894,14 +886,6 @@ def init(self, database, **kwargs):
super().init(database, **kwargs)
self.init_async()

@property
def use_speedups(self):
return False

@use_speedups.setter
def use_speedups(self, value):
pass


register_database(PooledPostgresqlDatabase, 'postgres+pool+async',
'postgresql+pool+async')
Expand Down Expand Up @@ -964,14 +948,6 @@ async def last_insert_id_async(self, cursor):
"""
return cursor.lastrowid

@property
def use_speedups(self):
return False

@use_speedups.setter
def use_speedups(self, value):
pass


register_database(MySQLDatabase, 'mysql+async')

Expand Down
42 changes: 16 additions & 26 deletions peewee_asyncext.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,24 @@ class PostgresqlExtDatabase(AsyncPostgresqlMixin, ext.PostgresqlExtDatabase):
See also:
https://peewee.readthedocs.io/en/latest/peewee/playhouse.html#PostgresqlExtDatabase
"""

def init(self, database, **kwargs):
self.min_connections = 1
self.max_connections = 1
super().init(database, **kwargs)
self.init_async(enable_json=True,
enable_hstore=self._register_hstore)

@property
def use_speedups(self):
return False

@use_speedups.setter
def use_speedups(self, value):
pass
self.init_async(
enable_json=True,
enable_hstore=self._register_hstore
)


register_database(PostgresqlExtDatabase, 'postgresext+async',
'postgresqlext+async')
register_database(PostgresqlExtDatabase, 'postgresext+async', 'postgresqlext+async')


class PooledPostgresqlExtDatabase(AsyncPostgresqlMixin,
ext.PostgresqlExtDatabase):
class PooledPostgresqlExtDatabase(
AsyncPostgresqlMixin,
ext.PostgresqlExtDatabase
):
"""PosgreSQL database extended driver providing **single drop-in sync**
connection and **async connections pool** interface.
Expand All @@ -71,22 +67,16 @@ class PooledPostgresqlExtDatabase(AsyncPostgresqlMixin,
See also:
https://peewee.readthedocs.io/en/latest/peewee/playhouse.html#PostgresqlExtDatabase
"""

def init(self, database, **kwargs):
self.min_connections = kwargs.pop('min_connections', 1)
self.max_connections = kwargs.pop('max_connections', 20)
self._timeout = kwargs.pop('connection_timeout', aiopg.DEFAULT_TIMEOUT)
super().init(database, **kwargs)
self.init_async(enable_json=True,
enable_hstore=self._register_hstore)

@property
def use_speedups(self):
return False

@use_speedups.setter
def use_speedups(self, value):
pass
self.init_async(
enable_json=True,
enable_hstore=self._register_hstore
)


register_database(PooledPostgresqlExtDatabase, 'postgresext+pool+async',
'postgresqlext+pool+async')
register_database(PooledPostgresqlExtDatabase, 'postgresext+pool+async', 'postgresqlext+pool+async')

0 comments on commit b54abbf

Please sign in to comment.