SlideShare a Scribd company logo
SyPy June 2013
● Introduction to SQLAlchemy - Roger Barnes
● Using Robot Framework for testing,
communication and world domination - Dylan Jay
● Configuration management with Salt Stack -
Daniel Bryan
● + lightning talks
● Pub
Introduction to SQL Alchemy - SyPy June 2013
SyPy June 2013
Next SyPy - Aug 1, 2013
http://bit.ly/11kHTmB
Introduction to
SQLAlchemy
Roger Barnes
SyPy June 2013
roger@mindsocket.com.au @mindsocket
About Me
15 years software development
4 years Python/Django
4 months SQLAlchemy
SQLAlchemy is...
Python SQL toolkit
&
Object Relational Mapper
About SQLAlchemy
● Full featured
● Mature, robust, documented, maintained
● Flexible
– Use what you need
– Extend when you need
– Database oriented
– Doesn't dictate schema design
– ...
Enterprise!
DB support
● SQLite
● Postgresql
● MySQL
● Oracle
● MS-SQL
● Firebird
● Sybase
● ...
Python support
cPython 2.5+
cPython 3+
Jython 2.5+
Pypy 1.5+
Compared with Django ORM?
● Both are good
● Key philosophical design difference
Django → Web applications
SQLAlchemy → Database applications
Compared with Django ORM?
● Django ORM
– easier to learn
– less flexible
– well suited for most web apps
– comes with a free admin app
Compared with Django ORM?
● SQLAlchemy
– harder to learn (but only a little)
– massively flexible
– suited to a wider range of
applications, especially those that
benefit from the power of an
RDBMS
Project Structure
SQLAlchemy is like an onion...
… or a cake
Structure
Core
● Abstraction over Python's DBAPI
● SQL language via generative
Python expressions
Core
● Good for DB performance
– bulk operations
– complex queries
– fine-tuning
– connection/tx management
Core
● Schema
– Managed by a Metadata object
– Declare tables, columns and
other attributes
– Closely aligned with Data
Definition Language
Core
● SQL Expressions
– INSERT, UPDATE, DELETE
– SELECT, joins, grouping
– Functions, expressions, operators
● Connection pooling
● Backend DB dialects
Demo
ORMs in General
● Simple case – translate between a
domain object and a table row
● More complex – arbitrary rows
mapped to an object
● Handle relationships
ORMs in General
● Query in terms of objects
● Represent class inheritance
● Data validation
SQLAlchemy ORM
● Layer on top of core
● Session based
● Session manages object state
SQLAlchemy ORM
● 2 ways to use
– Classical Mapping
● Define table
● Define object
● Configure mapper
– Modern - Declarative
● Shorthand combining table metadata and
class mapping
● Similar to Django ORM
Demo
Questions?
● Other resources
– SQLAlchemy - http://sqlalchemy.org/
– Longer (better) introduction -
http://bit.ly/13UQXVV
● Contact
roger@mindsocket.com.au
@mindsocket

More Related Content

What's hot (20)

PPTX
Is SQLcl the Next Generation of SQL*Plus?
Zohar Elkayam
 
PPTX
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
Michael Rys
 
PPTX
Do IT with SQL
Nur Hidayat
 
PPTX
Design Concepts For Xml Applications That Will Perform
Marco Gralike
 
PDF
PL/SQL New and Advanced Features for Extreme Performance
Zohar Elkayam
 
PPTX
U-SQL Intro (SQLBits 2016)
Michael Rys
 
ODP
ORM, JPA, & Hibernate Overview
Brett Meyer
 
PPTX
L04 base patterns
Ólafur Andri Ragnarsson
 
PPTX
U-SQL Killer Scenarios: Custom Processing, Big Cognition, Image and JSON Proc...
Michael Rys
 
PPTX
Hive @ Bucharest Java User Group
Remus Rusanu
 
PPTX
Introduce to XML
videde_group
 
PPTX
Hibernate inheritance and relational mappings with examples
Er. Gaurav Kumar
 
PPTX
U-SQL Does SQL (SQLBits 2016)
Michael Rys
 
PPT
Oracle by Muhammad Iqbal
YOUTH MEDIA AGENCY
 
PPTX
ADL/U-SQL Introduction (SQLBits 2016)
Michael Rys
 
PDF
Extensible Data Modeling
Karwin Software Solutions LLC
 
PPTX
ApacheCon North America 2018: Creating Spark Data Sources
Jayesh Thakrar
 
PPT
Css
myrajendra
 
ODP
BlackRay FOSS Asia 2010
fschupp
 
Is SQLcl the Next Generation of SQL*Plus?
Zohar Elkayam
 
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
Michael Rys
 
Do IT with SQL
Nur Hidayat
 
Design Concepts For Xml Applications That Will Perform
Marco Gralike
 
PL/SQL New and Advanced Features for Extreme Performance
Zohar Elkayam
 
U-SQL Intro (SQLBits 2016)
Michael Rys
 
ORM, JPA, & Hibernate Overview
Brett Meyer
 
L04 base patterns
Ólafur Andri Ragnarsson
 
U-SQL Killer Scenarios: Custom Processing, Big Cognition, Image and JSON Proc...
Michael Rys
 
Hive @ Bucharest Java User Group
Remus Rusanu
 
Introduce to XML
videde_group
 
Hibernate inheritance and relational mappings with examples
Er. Gaurav Kumar
 
U-SQL Does SQL (SQLBits 2016)
Michael Rys
 
Oracle by Muhammad Iqbal
YOUTH MEDIA AGENCY
 
ADL/U-SQL Introduction (SQLBits 2016)
Michael Rys
 
Extensible Data Modeling
Karwin Software Solutions LLC
 
ApacheCon North America 2018: Creating Spark Data Sources
Jayesh Thakrar
 
BlackRay FOSS Asia 2010
fschupp
 

Viewers also liked (6)

PDF
IOUG93 - Technical Architecture for the Data Warehouse - Presentation
David Walker
 
PDF
Cloud Computing Strategy and Architecture
Hendrix Yapputro , Certified IT Architect
 
PPTX
Modernizing Architecture for a Complete Data Strategy
Cloudera, Inc.
 
PPTX
Enterprise Data Architect Job Description
Lars E Martinsson
 
PPT
Data Architecture for Data Governance
DATAVERSITY
 
PPTX
Enterprise Data Architecture Deliverables
Lars E Martinsson
 
IOUG93 - Technical Architecture for the Data Warehouse - Presentation
David Walker
 
Cloud Computing Strategy and Architecture
Hendrix Yapputro , Certified IT Architect
 
Modernizing Architecture for a Complete Data Strategy
Cloudera, Inc.
 
Enterprise Data Architect Job Description
Lars E Martinsson
 
Data Architecture for Data Governance
DATAVERSITY
 
Enterprise Data Architecture Deliverables
Lars E Martinsson
 
Ad

Similar to Introduction to SQL Alchemy - SyPy June 2013 (20)

PDF
Introduction To Pentaho Kettle
Boulder Java User's Group
 
PDF
Object Relational Mapping with Dapper (Micro ORM)
Muhammad Umar
 
ODP
An Introduction to Pentaho Kettle
Dan Moore
 
PDF
Architecting Database by Jony Sugianto (Detik.com)
Tech in Asia ID
 
PPTX
data-scientist-learning-path.pptx
sandipkishore
 
PDF
Using Joomla, Zoo & SOLR to power Asia's Largest Auction House
Parth Lawate
 
PDF
Data analysis with Pandas and Spark
Felix Crisan
 
ODP
Are we there yet?
Johann Höchtl
 
PDF
No sql bigdata and postgresql
Zaid Shabbir
 
PDF
Development without Constraint
Chad Davis
 
PDF
Scala Days Highlights | BoldRadius
BoldRadius Solutions
 
PDF
JPoint'15 Mom, I so wish Hibernate for my NoSQL database...
Alexey Zinoviev
 
PDF
Spark Workflow Management
Romi Kuntsman
 
PPTX
NoSQL document oriented data access for .net systems with postgresql and marten
Bojan Veljanovski
 
PDF
Getting started with Apache Spark in Python - PyLadies Toronto 2016
Holden Karau
 
PDF
Beyond Wordcount with spark datasets (and scalaing) - Nide PDX Jan 2018
Holden Karau
 
PDF
Drupal and the Semantic Web - ESIP Webinar
scorlosquet
 
PDF
Improving PySpark performance: Spark Performance Beyond the JVM
Holden Karau
 
PDF
A compute infrastructure for data scientists
Stitch Fix Algorithms
 
PDF
kranonit S06E01 Игорь Цинько: High load
Krivoy Rog IT Community
 
Introduction To Pentaho Kettle
Boulder Java User's Group
 
Object Relational Mapping with Dapper (Micro ORM)
Muhammad Umar
 
An Introduction to Pentaho Kettle
Dan Moore
 
Architecting Database by Jony Sugianto (Detik.com)
Tech in Asia ID
 
data-scientist-learning-path.pptx
sandipkishore
 
Using Joomla, Zoo & SOLR to power Asia's Largest Auction House
Parth Lawate
 
Data analysis with Pandas and Spark
Felix Crisan
 
Are we there yet?
Johann Höchtl
 
No sql bigdata and postgresql
Zaid Shabbir
 
Development without Constraint
Chad Davis
 
Scala Days Highlights | BoldRadius
BoldRadius Solutions
 
JPoint'15 Mom, I so wish Hibernate for my NoSQL database...
Alexey Zinoviev
 
Spark Workflow Management
Romi Kuntsman
 
NoSQL document oriented data access for .net systems with postgresql and marten
Bojan Veljanovski
 
Getting started with Apache Spark in Python - PyLadies Toronto 2016
Holden Karau
 
Beyond Wordcount with spark datasets (and scalaing) - Nide PDX Jan 2018
Holden Karau
 
Drupal and the Semantic Web - ESIP Webinar
scorlosquet
 
Improving PySpark performance: Spark Performance Beyond the JVM
Holden Karau
 
A compute infrastructure for data scientists
Stitch Fix Algorithms
 
kranonit S06E01 Игорь Цинько: High load
Krivoy Rog IT Community
 
Ad

More from Roger Barnes (6)

PDF
The life of a web request - techniques for measuring and improving Django app...
Roger Barnes
 
PDF
Building data flows with Celery and SQLAlchemy
Roger Barnes
 
PDF
Poker, packets, pipes and Python
Roger Barnes
 
PDF
Towards Continuous Deployment with Django
Roger Barnes
 
PDF
Scraping recalcitrant web sites with Python & Selenium
Roger Barnes
 
PDF
Intro to Pinax: Kickstarting Your Django Apps
Roger Barnes
 
The life of a web request - techniques for measuring and improving Django app...
Roger Barnes
 
Building data flows with Celery and SQLAlchemy
Roger Barnes
 
Poker, packets, pipes and Python
Roger Barnes
 
Towards Continuous Deployment with Django
Roger Barnes
 
Scraping recalcitrant web sites with Python & Selenium
Roger Barnes
 
Intro to Pinax: Kickstarting Your Django Apps
Roger Barnes
 

Recently uploaded (20)

PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
July Patch Tuesday
Ivanti
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
July Patch Tuesday
Ivanti
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 

Introduction to SQL Alchemy - SyPy June 2013