Re: [sqlalchemy] How right use session/scoped_session in web app?

2018-01-27 Thread Евгений Рымарев
I receive this error: This result object does not return rows. It has been closed automatically. суббота, 27 января 2018 г., 1:09:53 UTC+3 пользователь Mike Bayer написал: > > On Fri, Jan 26, 2018 at 4:21 PM, Евгений Рымарев > > wrote: > > Hello, everyone! >

Re: [sqlalchemy] How right use session/scoped_session in web app?

2018-01-27 Thread Евгений Рымарев
написал: > > On Fri, Jan 26, 2018 at 4:21 PM, Евгений Рымарев > > wrote: > > Hello, everyone! > > Engine: > > engine = create_engine( > > > > > 'mssql+pymssql://{LOGIN}:{PASSWORD}@{HOST}/{DATABASE}?charset={CHARSET}'.format(**D

[sqlalchemy] How right use session/scoped_session in web app?

2018-01-26 Thread Евгений Рымарев
Hello, everyone! Engine: engine = create_engine( 'mssql+pymssql://{LOGIN}:{PASSWORD}@{HOST}/{DATABASE}?charset={CHARSET}'.format(**DATABASE), isolation_level='READ COMMITTED' ) My first decorator for session: @decorator_with_args def session_decorator(func, default=None): def wrapper(

[sqlalchemy] [MSSQL] SELECT * INTO #tmptbl FROM table

2017-12-16 Thread Евгений Рымарев
Hello! How i can create something like that: SELECT column INTO #tmptbl FROM table SELECT * FROM table2 t2 WHERE EXISTS(SELECT 1 FROM #tmptbl WHERE column = t2.column) in SQLAlchemy I imagine it like this: tmptbl = session.query(table.c.column).into('#tmptbl') subqu1 = s

[sqlalchemy] Re: [MSSQL] SELECT * INTO #tmptbl FROM table

2017-12-16 Thread Евгений Рымарев
In SQLAlchemy code last string must be like this of course result = session.query(table2).filter(subqu1) суббота, 16 декабря 2017 г., 11:41:12 UTC+3 пользователь Евгений Рымарев написал: > > Hello! > How i can create something like that: > SELECT column > INTO #tmptbl > FRO

[sqlalchemy] [MSSQL] SELECT * INTO #tmptbl FROM table

2017-12-16 Thread Евгений Рымарев
Hello! How i can create something like that: SELECT column INTO #tmptbl FROM table SELECT * FROM table2 t2 WHERE EXISTS(SELECT 1 FROM #tmptbl WHERE column = t2.column) in SQLAlchemy I imagine it like this: tmptbl = session.query(table.c.column).into('#tmptbl') subqu1 = s

[sqlalchemy] Re: Flask app, sqlalchemy and daemon - how right connect to db?

2017-03-03 Thread Евгений Рымарев
egies.py", line 105, in connect return dialect.connect(*cargs, **cparams) File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 393, in connect return self.dbapi.connect(*cargs, **cparams) File "/usr/local/lib/python3.5/site-packages/fdb/fbc

[sqlalchemy] Re: Flask app, sqlalchemy and daemon - how right connect to db?

2017-03-03 Thread Евгений Рымарев
quot;. пятница, 3 марта 2017 г., 20:08:45 UTC+3 пользователь Евгений Рымарев написал: > > Hello everyone! > I have Flask app with using flask_sqlalchemy: > > from flask import Flask > from flask_sqlalchemy import SQLAlchemy > app = Flask(__name__) > app.config.from_pyfile(fi

[sqlalchemy] Flask app, sqlalchemy and daemon - how right connect to db?

2017-03-03 Thread Евгений Рымарев
Hello everyone! I have Flask app with using flask_sqlalchemy: from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.from_pyfile(filename='settings.py', silent=True) db = SQLAlchemy(app=app) I want connect to same database from daemon. In daemon i just im