using python pony orm with postgres(aws rds)... using it to execute raw sql ... so i created a wrapper class around pony classes to initialize database object
self.db = Database()
self.db.bind(provider="postgres", user=self.username, password=self.password,
host=self.hostname, database=self.database)
every time a method is called to execute raw sql query(below line), a new connection is made. when does connection pooling kick in
self.db.execute(query, query_args)
or is there a way to set connection pooling params.
As per pony orm docs
Connection pool. There is no need to keep track of database connections. You have the connection when you need it and when you have finished your transaction the connection will be returned to the pool.
but I see the connections are always opened everytime a select call is made. e.g: 5 calls results in 5 connections. How can i set max. number of connections?