wow.... the pool and the engine are also totally different concepts. the engine deals with the pool automatically.
engine = create_engine('sqlite://' + DOCUMENT_ROOT + 'alchemy.db')
table = Table('mytable', engine, Column('mycol', Integer))
result = table.select().execute()
seriously....dont build a whole app yet...just play with some very rudimentary examples to start. itll be quicker in the end. The error is still there. I tried to specify a connection: engine = \ sqlalchemy.create_engine("sqlite", {"filename":DOCUMENT_ROOT + \ "alchemy.db"}) pool = sqlalchemy.pool.QueuePool(get_connection) and get_connection is: def get_connection(): return sqlite.connect(DOCUMENT_ROOT + "alchemy.db") Am I barking up the wrong tree, or do I need to do something more to tell it where to look for its connections?
On 4/1/06, Jonathan Hayward http://JonathansCorner.com <[EMAIL PROTECTED]> wrote: When I tried to call .execute() for a Select object, I get the following error: Traceback (most recent call last): File "/server1/users/jonathan/creations/inventions/software/insight/alchemy", line 5807, in ? multitasking.start_oracle() File "/server1/users/jonathan/creations/inventions/software/insight/alchemy", line 3474, in start_oracle self.run_oracle() File "/server1/users/jonathan/creations/inventions/software/insight/alchemy", line 3435, in run_oracle self.handle_oracle_query(newsocket, address) File "/server1/users/jonathan/creations/inventions/software/insight/alchemy", line 3382, in handle_oracle_query generate_output() File "/server1/users/jonathan/creations/inventions/software/insight/alchemy", line 5122, in generate_output current_frame.display() File "/server1/users/jonathan/creations/inventions/software/insight/alchemy", line 2776, in display build_output_for_appropriate_search_results() File "/server1/users/jonathan/creations/inventions/software/insight/alchemy", line 4551, in build_output_for_appropriate_search_results get_cgi("title_prefix"), criteria) File "/server1/users/jonathan/creations/inventions/software/insight/alchemy", line 574, in get_search_results return self.get_information("search_results", (query_string, \ File "/server1/users/jonathan/creations/inventions/software/insight/alchemy", line 511, in get_information parameters) File "/server1/users/jonathan/creations/inventions/software/insight/alchemy", line 556, in get_information_internal result = my_search.search() File "/server1/users/jonathan/creations/inventions/software/insight/alchemy", line 3696, in search return self.database_search() File "/server1/users/jonathan/creations/inventions/software/insight/alchemy", line 3689, in database_search order_by=[sqlalchemy.desc(document_table.columns.last_viewed)]).execute() File "build/bdist.linux-i686/egg/sqlalchemy/sql.py", line 374, in execute File "build/bdist.linux-i686/egg/sqlalchemy/sql.py", line 272, in execute File "build/bdist.linux-i686/egg/sqlalchemy/engine.py", line 492, in execute_compiled File "build/bdist.linux-i686/egg/sqlalchemy/engine.py", line 349, in connection File "build/bdist.linux-i686/egg/sqlalchemy/pool.py", line 79, in connect File "build/bdist.linux-i686/egg/sqlalchemy/pool.py", line 101, in __init__ File "build/bdist.linux-i686/egg/sqlalchemy/pool.py", line 138, in get File "build/bdist.linux-i686/egg/sqlalchemy/pool.py", line 219, in <lambda> AttributeError: 'NoneType' object has no attribute 'connect' Is this a symptom that I don't have a database connection? After initially specifying mysql, I have: engine = \ sqlalchemy.create_engine("sqlite", {"filename":DOCUMENT_ROOT + \ "alchemy.db"}) but in the directory referred to by DOCUMENT_ROOT, there is no alchemy.db. What do I need to do to create the database file if it doesn't exist? Is there anything else I need to do to connect?
-- ++ Jonathan Hayward, [EMAIL PROTECTED] ** To see an award-winning website with stories, essays, artwork, ** games, and a four-dimensional maze, why not visit my home page? ** All of this is waiting for you at http://JonathansCorner.com
** If you'd like a Google Mail (gmail.com) account, please tell me!
-- ++ Jonathan Hayward, [EMAIL PROTECTED] ** To see an award-winning website with stories, essays, artwork, ** games, and a four-dimensional maze, why not visit my home page? ** All of this is waiting for you at http://JonathansCorner.com
** If you'd like a Google Mail ( gmail.com) account, please tell me! |