Wondering how db connection is established?
See original GitHub issueHey @frol , Great work on this prokect! A quick question regarding using a different db like: postgresql After I set postgres connection url, example api server doesn’t recognize it (I got some error, and search results suggest db is not connected). (it seems it only works with sqlite). I went on to try to find out why, I found this piece:
def init_app(self, app):
super(SQLAlchemy, self).init_app(app)
database_uri = app.config['SQLALCHEMY_DATABASE_URI']
if database_uri and database_uri.startswith('sqlite:'):
self.event.listens_for(engine.Engine, "connect")(set_sqlite_pragma)
app.extensions['migrate'] = AlembicDatabaseMigrationConfig(self, compare_type=True)
in app/extensions/flask_sqlalchemy/__init__.py
is doing the db initialization part. However, it is not using create_engine
from sqlalchemy
, and it is also not setting listening for posgresql db is provided in environment. So I conclude posgresql is not supported yet.
Maybe I am misunderstanding, can you comment on how postgresql is connected is in production mode ?
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
What is Connection Pooling, and Why Should You Care
Database connection pooling is a way to reduce the cost of opening and closing connections by maintaining a “pool” of open connections that...
Read more >How the database connection is built in the deployment
1 Answer 1 ... Simply you could use the server: localhost\sqlexpress in your connection string of your file app.config, assuming that you will ......
Read more >Database Connections and Connection Pooling - YouTube
A database connection allows client software to talk to database server. A connection pool is a cache of database connections maintained so ...
Read more >Database Connections: Less is More | by Wahome - Medium
A web server constantly sends out pieces of information to users in order to compose web pages. It constantly performs I/O operations to...
Read more >Database connection - Wikipedia
A database connection is a facility in computer science that allows client software to talk to database server software, whether on the same...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I cannot access this postgresql from my local machine:
psql
client says the same thing, so it has nothing to do with SQLAlchemy.@10000TB FYI: https://github.com/frol/flask-restplus-server-example/commit/3703135911fed3e1ec126423662749d222b32c23