SQLAlchemy: Difference between revisions
Brian Wilson (talk | contribs) mNo edit summary |
Brian Wilson (talk | contribs) |
||
Line 16: | Line 16: | ||
I tried SQLAlchemy out about a year ago then moved on. I just wrote code that talked directly to PostgreSQL. Now that I am diving into [[Flask]], I need to look at it again. Back then I was working PHP and also directly with SQL, so I felt sqlalchemy just got in my way. | I tried SQLAlchemy out about a year ago then moved on. I just wrote code that talked directly to PostgreSQL. Now that I am diving into [[Flask]], I need to look at it again. Back then I was working PHP and also directly with SQL, so I felt sqlalchemy just got in my way. | ||
The big plus at the moment for me is that I can write one piece of code and have it talk to both sqlite files and real databases including PostgreSQL and MySQL. This make testing and developing on a laptop with sqlite and then migrating to a database server very easy. I hope. | The big plus at the moment for me is that I can write one piece of code and have it talk to both [[sqlite]] files and real databases including PostgreSQL and MySQL. This make testing and developing on a laptop with sqlite and then migrating to a database server very easy. I hope. | ||
[[Category: SQL]] | [[Category: SQL]] |
Revision as of 18:43, 11 June 2015
SQLAlchemy is an ORM (Object Relational Mapper) for Python which means it makes the data in a SQL database accessible to Python programs as objects.
Where to turn for info
I found these pages useful in my initial foray
http://tspycher.com/2012/11/python-and-sqlalchemy-0-8-example/
http://www.blog.pythonlibrary.org/2012/07/01/a-simple-sqlalchemy-0-7-0-8-tutorial/
My sqlalchemy journey continues
I tried SQLAlchemy out about a year ago then moved on. I just wrote code that talked directly to PostgreSQL. Now that I am diving into Flask, I need to look at it again. Back then I was working PHP and also directly with SQL, so I felt sqlalchemy just got in my way.
The big plus at the moment for me is that I can write one piece of code and have it talk to both sqlite files and real databases including PostgreSQL and MySQL. This make testing and developing on a laptop with sqlite and then migrating to a database server very easy. I hope.