OHLC's and datamain.py; update DB and package requirements.

This commit is contained in:
tim
2024-01-21 21:04:52 -04:00
parent 8b113563b3
commit c154f13f7c
20 changed files with 499 additions and 179 deletions

View File

@@ -1,3 +1,4 @@
import sys
from logging.config import fileConfig
from sqlalchemy import engine_from_config
@@ -11,7 +12,7 @@ config = context.config
# Interpret the config file for Python logging.
# This line sets up loggers basically.
if config.config_file_name is not None:
if config.config_file_name is not None and sys.argv[0].endswith('alembic'): # only configure logs if we are the alembic process not dexorder
fileConfig(config.config_file_name)
# DEXORDER SETUP
@@ -19,7 +20,8 @@ from sys import path
path.append('src')
import dexorder.database.model
target_metadata = dexorder.database.model.Base.metadata
config.set_main_option('sqlalchemy.url', dexorder.config.db_url)
if not config.get_main_option('sqlalchemy.url'):
config.set_main_option('sqlalchemy.url', dexorder.config.db_url)
# other values from the config, defined by the needs of env.py,
# can be acquired:

View File

@@ -77,7 +77,7 @@ def upgrade() -> None:
op.create_table('pool',
sa.Column('chain', dexorder.database.column_types.Blockchain(), nullable=False),
sa.Column('address', dexorder.database.column_types.Address(), nullable=False),
sa.Column('exchange', sa.Enum('UniswapV2', 'UniswapV3', name='exchange'), nullable=False),
sa.Column('exchange', sa.Enum('Unknown', 'UniswapV2', 'UniswapV3', name='exchange'), nullable=False),
sa.Column('base', dexorder.database.column_types.Address(), nullable=False),
sa.Column('quote', dexorder.database.column_types.Address(), nullable=False),
sa.Column('fee', sa.Integer(), nullable=False),