pylav.storage.database.tables package¶
Submodules¶
pylav.storage.database.tables.aiohttp_cache module¶
- class pylav.storage.database.tables.aiohttp_cache.AioHttpCacheRow(_data=None, _ignore_missing=False, _exists_in_db=False, **kwargs)[source]¶
Bases:
Table- key¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- value¶
Used for storing bytes.
Example
class Token(Table): token = Bytea(default=b'token123') # Create >>> await Token(token=b'my-token').save() # Query >>> await Token.select(Token.token) {'token': b'my-token'}
pylav.storage.database.tables.config module¶
- class pylav.storage.database.tables.config.LibConfigRow(_data=None, _ignore_missing=False, _exists_in_db=False, **kwargs)[source]¶
Bases:
Table- auto_update_managed_nodes¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- bot¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- config_folder¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- download_id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- enable_managed_node¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- extras¶
Used for storing JSON strings - Postgres only. The data is stored in a binary format, and can be queried. Insertion can be slower (as it needs to be converted to the binary format). The benefits of JSONB generally outweigh the downsides.
- Parameters:
default – Either a JSON string can be provided, or a Python
dictorlistwhich is then converted to a JSON string.
- id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- java_path¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- localtrack_folder¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- next_execution_update_bundled_external_playlists¶
Used for storing timezone aware datetimes. Uses the
datetimetype for values. The values are converted to UTC in the database, and are also returned as UTC.Example
import datetime class Concert(Table): starts = Timestamptz() # Create >>> await Concert( ... starts=datetime.datetime( ... year=2050, month=1, day=1, tzinfo=datetime.timezone.tz ... ) ... ).save() # Query >>> await Concert.select(Concert.starts) { 'starts': datetime.datetime( 2050, 1, 1, 0, 0, tzinfo=datetime.timezone.utc ) }
- next_execution_update_bundled_playlists¶
Used for storing timezone aware datetimes. Uses the
datetimetype for values. The values are converted to UTC in the database, and are also returned as UTC.Example
import datetime class Concert(Table): starts = Timestamptz() # Create >>> await Concert( ... starts=datetime.datetime( ... year=2050, month=1, day=1, tzinfo=datetime.timezone.tz ... ) ... ).save() # Query >>> await Concert.select(Concert.starts) { 'starts': datetime.datetime( 2050, 1, 1, 0, 0, tzinfo=datetime.timezone.utc ) }
- next_execution_update_external_playlists¶
Used for storing timezone aware datetimes. Uses the
datetimetype for values. The values are converted to UTC in the database, and are also returned as UTC.Example
import datetime class Concert(Table): starts = Timestamptz() # Create >>> await Concert( ... starts=datetime.datetime( ... year=2050, month=1, day=1, tzinfo=datetime.timezone.tz ... ) ... ).save() # Query >>> await Concert.select(Concert.starts) { 'starts': datetime.datetime( 2050, 1, 1, 0, 0, tzinfo=datetime.timezone.utc ) }
- update_bot_activity¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- use_bundled_lava_link_external¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- use_bundled_pylav_external¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
pylav.storage.database.tables.equalizer module¶
- class pylav.storage.database.tables.equalizer.EqualizerRow(_data=None, _ignore_missing=False, _exists_in_db=False, **kwargs)[source]¶
Bases:
Table- author¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- band_100¶
An alias for Real.
- band_1000¶
An alias for Real.
- band_10000¶
An alias for Real.
- band_160¶
An alias for Real.
- band_1600¶
An alias for Real.
- band_16000¶
An alias for Real.
- band_25¶
An alias for Real.
- band_250¶
An alias for Real.
- band_2500¶
An alias for Real.
- band_40¶
An alias for Real.
- band_400¶
An alias for Real.
- band_4000¶
An alias for Real.
- band_63¶
An alias for Real.
- band_630¶
An alias for Real.
- band_6300¶
An alias for Real.
- description¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- name¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- scope¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
pylav.storage.database.tables.m2m module¶
pylav.storage.database.tables.misc module¶
pylav.storage.database.tables.nodes module¶
- class pylav.storage.database.tables.nodes.NodeRow(_data=None, _ignore_missing=False, _exists_in_db=False, **kwargs)[source]¶
Bases:
Table- disabled_sources¶
Used for storing lists of data.
Example
class Ticket(Table): seat_numbers = Array(base_column=Integer()) # Create >>> await Ticket(seat_numbers=[34, 35, 36]).save() # Query >>> await Ticket.select(Ticket.seat_numbers) {'seat_numbers': [34, 35, 36]}
- extras¶
Used for storing JSON strings - Postgres only. The data is stored in a binary format, and can be queried. Insertion can be slower (as it needs to be converted to the binary format). The benefits of JSONB generally outweigh the downsides.
- Parameters:
default – Either a JSON string can be provided, or a Python
dictorlistwhich is then converted to a JSON string.
- id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- managed¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- name¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- reconnect_attempts¶
Used for storing whole numbers. Uses the
inttype for values.Example
class Band(Table): popularity = Integer() # Create >>> await Band(popularity=1000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000}
- resume_key¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- resume_timeout¶
Used for storing whole numbers. Uses the
inttype for values.Example
class Band(Table): popularity = Integer() # Create >>> await Band(popularity=1000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000}
- search_only¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- ssl¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- yaml¶
Used for storing JSON strings - Postgres only. The data is stored in a binary format, and can be queried. Insertion can be slower (as it needs to be converted to the binary format). The benefits of JSONB generally outweigh the downsides.
- Parameters:
default – Either a JSON string can be provided, or a Python
dictorlistwhich is then converted to a JSON string.
- class pylav.storage.database.tables.nodes.Sessions(_data=None, _ignore_missing=False, _exists_in_db=False, **kwargs)[source]¶
Bases:
Table- bot¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- id¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- node¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- primary_key¶
Used for storing UUIDs - in Postgres a UUID column type is used, and in SQLite it’s just a Varchar. Uses the
uuid.UUIDtype for values.Example
import uuid class Band(Table): uuid = UUID() # Create >>> await DiscountCode(code=uuid.uuid4()).save() # Query >>> await DiscountCode.select(DiscountCode.code) {'code': UUID('09c4c17d-af68-4ce7-9955-73dcd892e462')}
pylav.storage.database.tables.player_state module¶
- class pylav.storage.database.tables.player_state.PlayerStateRow(_data=None, _ignore_missing=False, _exists_in_db=False, **kwargs)[source]¶
Bases:
Table- auto_play¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- auto_play_playlist_id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- auto_shuffle¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- bot¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- channel_id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- current¶
Used for storing JSON strings - Postgres only. The data is stored in a binary format, and can be queried. Insertion can be slower (as it needs to be converted to the binary format). The benefits of JSONB generally outweigh the downsides.
- Parameters:
default – Either a JSON string can be provided, or a Python
dictorlistwhich is then converted to a JSON string.
- effect_enabled¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- effects¶
Used for storing JSON strings - Postgres only. The data is stored in a binary format, and can be queried. Insertion can be slower (as it needs to be converted to the binary format). The benefits of JSONB generally outweigh the downsides.
- Parameters:
default – Either a JSON string can be provided, or a Python
dictorlistwhich is then converted to a JSON string.
- extras¶
Used for storing JSON strings - Postgres only. The data is stored in a binary format, and can be queried. Insertion can be slower (as it needs to be converted to the binary format). The benefits of JSONB generally outweigh the downsides.
- Parameters:
default – Either a JSON string can be provided, or a Python
dictorlistwhich is then converted to a JSON string.
- forced_channel_id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- history¶
Used for storing JSON strings - Postgres only. The data is stored in a binary format, and can be queried. Insertion can be slower (as it needs to be converted to the binary format). The benefits of JSONB generally outweigh the downsides.
- Parameters:
default – Either a JSON string can be provided, or a Python
dictorlistwhich is then converted to a JSON string.
- id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- notify_channel_id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- paused¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- playing¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- position¶
An alias for Real.
- primary_key¶
Used for storing UUIDs - in Postgres a UUID column type is used, and in SQLite it’s just a Varchar. Uses the
uuid.UUIDtype for values.Example
import uuid class Band(Table): uuid = UUID() # Create >>> await DiscountCode(code=uuid.uuid4()).save() # Query >>> await DiscountCode.select(DiscountCode.code) {'code': UUID('09c4c17d-af68-4ce7-9955-73dcd892e462')}
- queue¶
Used for storing JSON strings - Postgres only. The data is stored in a binary format, and can be queried. Insertion can be slower (as it needs to be converted to the binary format). The benefits of JSONB generally outweigh the downsides.
- Parameters:
default – Either a JSON string can be provided, or a Python
dictorlistwhich is then converted to a JSON string.
- repeat_current¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- repeat_queue¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- self_deaf¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- shuffle¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- text_channel_id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- volume¶
Used for storing whole numbers. Uses the
inttype for values.Example
class Band(Table): popularity = Integer() # Create >>> await Band(popularity=1000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000}
pylav.storage.database.tables.players module¶
- class pylav.storage.database.tables.players.PlayerRow(_data=None, _ignore_missing=False, _exists_in_db=False, **kwargs)[source]¶
Bases:
Table- alone_dc¶
Used for storing JSON strings - Postgres only. The data is stored in a binary format, and can be queried. Insertion can be slower (as it needs to be converted to the binary format). The benefits of JSONB generally outweigh the downsides.
- Parameters:
default – Either a JSON string can be provided, or a Python
dictorlistwhich is then converted to a JSON string.
- alone_pause¶
Used for storing JSON strings - Postgres only. The data is stored in a binary format, and can be queried. Insertion can be slower (as it needs to be converted to the binary format). The benefits of JSONB generally outweigh the downsides.
- Parameters:
default – Either a JSON string can be provided, or a Python
dictorlistwhich is then converted to a JSON string.
- auto_play¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- auto_play_playlist_id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- auto_shuffle¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- bot¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- dj_roles¶
Used for storing lists of data.
Example
class Ticket(Table): seat_numbers = Array(base_column=Integer()) # Create >>> await Ticket(seat_numbers=[34, 35, 36]).save() # Query >>> await Ticket.select(Ticket.seat_numbers) {'seat_numbers': [34, 35, 36]}
- dj_users¶
Used for storing lists of data.
Example
class Ticket(Table): seat_numbers = Array(base_column=Integer()) # Create >>> await Ticket(seat_numbers=[34, 35, 36]).save() # Query >>> await Ticket.select(Ticket.seat_numbers) {'seat_numbers': [34, 35, 36]}
- effects¶
Used for storing JSON strings - Postgres only. The data is stored in a binary format, and can be queried. Insertion can be slower (as it needs to be converted to the binary format). The benefits of JSONB generally outweigh the downsides.
- Parameters:
default – Either a JSON string can be provided, or a Python
dictorlistwhich is then converted to a JSON string.
- empty_queue_dc¶
Used for storing JSON strings - Postgres only. The data is stored in a binary format, and can be queried. Insertion can be slower (as it needs to be converted to the binary format). The benefits of JSONB generally outweigh the downsides.
- Parameters:
default – Either a JSON string can be provided, or a Python
dictorlistwhich is then converted to a JSON string.
- extras¶
Used for storing JSON strings - Postgres only. The data is stored in a binary format, and can be queried. Insertion can be slower (as it needs to be converted to the binary format). The benefits of JSONB generally outweigh the downsides.
- Parameters:
default – Either a JSON string can be provided, or a Python
dictorlistwhich is then converted to a JSON string.
- forced_channel_id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- max_volume¶
Used for storing whole numbers. Uses the
inttype for values.Example
class Band(Table): popularity = Integer() # Create >>> await Band(popularity=1000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000}
- notify_channel_id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- primary_key¶
Used for storing UUIDs - in Postgres a UUID column type is used, and in SQLite it’s just a Varchar. Uses the
uuid.UUIDtype for values.Example
import uuid class Band(Table): uuid = UUID() # Create >>> await DiscountCode(code=uuid.uuid4()).save() # Query >>> await DiscountCode.select(DiscountCode.code) {'code': UUID('09c4c17d-af68-4ce7-9955-73dcd892e462')}
- repeat_current¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- repeat_queue¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- self_deaf¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- shuffle¶
Used for storing
True/Falsevalues. Uses thebooltype for values.Example
class Band(Table): has_drummer = Boolean() # Create >>> await Band(has_drummer=True).save() # Query >>> await Band.select(Band.has_drummer) {'has_drummer': True}
- text_channel_id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- volume¶
Used for storing whole numbers. Uses the
inttype for values.Example
class Band(Table): popularity = Integer() # Create >>> await Band(popularity=1000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000}
pylav.storage.database.tables.playlists module¶
- class pylav.storage.database.tables.playlists.PlaylistRow(_data=None, _ignore_missing=False, _exists_in_db=False, **kwargs)[source]¶
Bases:
Table- author¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- id¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- name¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- scope¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- tracks = <piccolo.columns.m2m.M2M object>¶
- url¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
pylav.storage.database.tables.queries module¶
pylav.storage.database.tables.tracks module¶
- class pylav.storage.database.tables.tracks.TrackRow(_data=None, _ignore_missing=False, _exists_in_db=False, **kwargs)[source]¶
Bases:
Table- artworkUrl¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- encoded¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- identifier¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- info¶
Used for storing JSON strings - Postgres only. The data is stored in a binary format, and can be queried. Insertion can be slower (as it needs to be converted to the binary format). The benefits of JSONB generally outweigh the downsides.
- Parameters:
default – Either a JSON string can be provided, or a Python
dictorlistwhich is then converted to a JSON string.
- isrc¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- playlists = <piccolo.columns.m2m.M2M object>¶
- pluginInfo¶
Used for storing JSON strings - Postgres only. The data is stored in a binary format, and can be queried. Insertion can be slower (as it needs to be converted to the binary format). The benefits of JSONB generally outweigh the downsides.
- Parameters:
default – Either a JSON string can be provided, or a Python
dictorlistwhich is then converted to a JSON string.
- queries = <piccolo.columns.m2m.M2M object>¶
- sourceName¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- title¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
- uri¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}
pylav.storage.database.tables.version module¶
- class pylav.storage.database.tables.version.BotVersionRow(_data=None, _ignore_missing=False, _exists_in_db=False, **kwargs)[source]¶
Bases:
Table- bot¶
In Postgres, this column supports large integers. In SQLite, it’s an alias to an Integer column, which already supports large integers. Uses the
inttype for values.Example
class Band(Table): value = BigInt() # Create >>> await Band(popularity=1000000).save() # Query >>> await Band.select(Band.popularity) {'popularity': 1000000}
- version¶
Use when you want to store large strings, and don’t want to limit the string size. Uses the
strtype for values.Example
class Band(Table): name = Text() # Create >>> await Band(name='Pythonistas').save() # Query >>> await Band.select(Band.name) {'name': 'Pythonistas'}