dgilland / sqlservice

The missing SQLAlchemy ORM interface.
https://sqlservice.readthedocs.io
MIT License
179 stars 9 forks source link

Invalid configs #33

Closed tabebqena closed 2 years ago

tabebqena commented 2 years ago

I used the configuration & the steps present in the README example :

     config ={
        "SQL_DATABASE_URI": "sqlite:///db.sql",
        "SQL_ISOLATION_LEVEL": "SERIALIZABLE",
        "SQL_ECHO": True,
       "SQL_ECHO_POOL": False,
        "SQL_CONVERT_UNICODE": True,
        "SQL_POOL_SIZE": 5,
        "SQL_POOL_TIMEOUT": 30,
        "SQL_POOL_RECYCLE": 3600,
       "SQL_MAX_OVERFLOW": 10,
       "SQL_AUTOCOMMIT": False,
       "SQL_AUTOFLUSH": True,
       "SQL_EXPIRE_ON_COMMIT": True
   }

   Model = declarative_base()
   sqlclient = SQLClient(config, model_class=Model)

But, It cause the following exception:

sqlclient = SQLClient(config, model_class=Model) File "/media/dr/Main/Others/Programming/PROGRAMMING/flask_apps/shop/my_shop/.venv/lib/python3.8/site-packages/sqlservice/client.py", line 297, in init self.engine = self.create_engine(self.settings.database_uri, self.settings.engine_options) File "/media/dr/Main/Others/Programming/PROGRAMMING/flask_apps/shop/my_shop/.venv/lib/python3.8/site-packages/sqlservice/client.py", line 320, in create_engine return sa.create_engine(make_url(uri), *options) File "", line 2, in create_engine File "/media/dr/Main/Others/Programming/PROGRAMMING/flask_apps/shop/my_shop/.venv/lib/python3.8/site-packages/sqlalchemy/util/deprecations.py", line 309, in warned return fn(args, **kwargs) File "/media/dr/Main/Others/Programming/PROGRAMMING/flask_apps/shop/my_shop/.venv/lib/python3.8/site-packages/sqlalchemy/engine/create.py", line 648, in create_engine raise TypeError( TypeError: Invalid argument(s) 'pool_size','pool_timeout','max_overflow' sent to create_engine(), using configuration SQLiteDialect_pysqlite/NullPool/Engine. Please check that the keyword arguments are appropriate for this combination of components.

Notes: SQLAlchemy: 1.4.29 SQLService: 1.3.0

dgilland commented 2 years ago

Sorry about that. The SQL_POOL_SIZE, SQL_POOL_TIMEOUT, and SQL_MAX_OVERFLOW options are not compatible with the sqlite engine Remove those and it should work.