]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
added page title via attributes to each document
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 26 Nov 2005 01:07:06 +0000 (01:07 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 26 Nov 2005 01:07:06 +0000 (01:07 +0000)
12 files changed:
doc/build/content/adv_datamapping.myt
doc/build/content/coolthings.myt [deleted file]
doc/build/content/datamapping.myt
doc/build/content/dbengine.myt
doc/build/content/docstrings.myt
doc/build/content/document_base.myt
doc/build/content/metadata.myt
doc/build/content/pooling.myt
doc/build/content/roadmap.myt
doc/build/content/sqlconstruction.myt
doc/build/content/types.myt
doc/build/content/unitofwork.myt

index 146a56a36f610fee1cee1e0637b33c824d527739..98aad5e767c1d108779b3bff3d9e16f7c5ba4787 100644 (file)
@@ -1,4 +1,5 @@
 <%flags>inherit='document_base.myt'</%flags>
+<%attr>title='Advanced Data Mapping'</%attr>
 <&|doclib.myt:item, name="adv_datamapping", description="Advanced Data Mapping" &>
 <p>This section is under construction.  For now, it has just the basic recipe for each concept without much else.  </p>
 
diff --git a/doc/build/content/coolthings.myt b/doc/build/content/coolthings.myt
deleted file mode 100644 (file)
index f47cab8..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-<%flags>inherit='document_base.myt'</%flags>
-
-
-
-<&|doclib.myt:item, name="coolthings", description="Cool Things You Can Do With SQLAlchemy" &>
-
-<&|formatting.myt:code, syntaxtype="python" &>
-       # first, some imports
-       from sqlalchemy.sql import *
-       from sqlalchemy.schema import *
-
-
-       # make a database engine based on sqlite
-       import sqlalchemy.databases.sqlite as sqlite_db
-       db = sqlite_db.engine('foo.db', pool_size = 10, max_overflow = 5)
-
-       # define metadata for a table
-
-       users = Table('users', db,
-               Column('user_id', INT),
-               Column('user_name', VARCHAR(20)),
-               Column('password', CHAR(10))
-       )
-
-
-       # select rows from the table
-
-       query = users.select()
-       cursor = query.execute()
-       rows = cursor.fetchall()
-
-
-       # select rows from the table where user_name=='ed'
-       rows = users.select(users.c.user_name == 'ed').execute().fetchall()
-
-       # make a query  with a bind param
-       query = select([users], users.c.user_id == bindparam('userid'))
-
-       # execute with params
-       rows = query.execute(userid = 7).fetchall()
-
-
-       # make another table
-       addresses = Table('addresses', db, 
-               Column('address_id', INT),
-               Column('user_id', INT),
-               Column('street', VARCHAR(20)),
-               Column('city', VARCHAR(20)),
-               Column('state', CHAR(2)),
-               Column('zip', CHAR(5))
-       )
-
-       # no, really, make this table in the DB via CREATE
-       addresses.build()
-
-
-       # make a nonsensical query that selects from an outer join, and 
-       # throws in a literally-defined EXISTS clause 
-       query = select(
-               [users, addresses],
-               and_(
-                   addresses.c.street == 'Green Street',
-                   addresses.c.city == 'New York',
-                   users.c.user_id != 12,
-                   "EXISTS (select 1 from special_table where user_id=users.user_id)"
-               ),
-               from_obj = [ outerjoin(users, addresses, addresses.user_id==users.user_id) ]
-               )
-
-
-       # insert into a table
-       users.insert().execute(user_id = 7, user_name = 'jack')
-
-       # update the table
-       users.update(users.c.user_id == 7).execute(user_name = 'fred')
-
-
-       # get DBAPI connections from the higher-level engine
-       c = db.connection()
-
-
-       # use the connection pooling directly:
-
-       # import a real DBAPI database
-       from pysqlite2 import dbapi2 as sqlite
-
-       # make an implicit pool around it
-       import sqlalchemy.pool as pool
-       sqlite = pool.manage(sqlite, pool_size = 10, max_overflow = 5, use_threadlocal = True)
-
-       # get a pooled connection local to the current thread
-       c = sqlite.connect('foo.db')
-       cursor = c.cursor()
-
-       # return the connection to the pool
-       cursor = None
-       c = None
-
-</&>
-
-</&>
index 0530b60d4d63cd6fefaf9f0361313452ff563443..9c8f631dcd2b8fb5c16511c7e6e89ad3873c3589 100644 (file)
@@ -1,4 +1,6 @@
 <%flags>inherit='document_base.myt'</%flags>
+<%attr>title='Data Mapping'</%attr>
+
 <&|doclib.myt:item, name="datamapping", description="Basic Data Mapping" &>
 <p>Data mapping describes the process of defining <b>Mapper</b> objects, which associate table metadata with user-defined classes.  
 
index 409dc48aea29f0d3a86cf8463fabadef7f831c6b..d9385c05ed430e8a196d6662e3d76988b05a1c6d 100644 (file)
@@ -1,4 +1,6 @@
 <%flags>inherit='document_base.myt'</%flags>
+<%attr>title='Database Engines'</%attr>
+
 <&|doclib.myt:item, name="dbengine", description="Database Engines" &>
     <p>A database engine is a subclass of <span class="codeline">sqlalchemy.engine.SQLEngine</span>, and is the starting point for where SQLAlchemy provides a layer of abstraction on top of the various DBAPI2 database modules.  It serves as an abstract factory for database-specific implementation objects as well as a layer of abstraction over the most essential tasks of a database connection, including connecting, executing queries, returning result sets, and managing transactions.</p>
     
index b52bd5516854964da8854af20bec93a914d37ec4..b45c90f757404e7be0aa54763f87e99a2b729968 100644 (file)
@@ -1,4 +1,5 @@
 <%flags>inherit='document_base.myt'</%flags>
+<%attr>title='Modules and Classes'</%attr>
 <&|doclib.myt:item, name="docstrings", description="Modules and Classes" &>
 <%init>
     import sqlalchemy.schema as schema
index 65110d8b1e5e31a6c3f57541174b2c9649f2e2aa..39355c916d8088c12df8c41293e71b92a1d5fa1f 100644 (file)
     version = '0.91'
 </%attr>
 
+<%method title>
+% try:
+#  avoid inheritance via attr instead of attributes
+    <% m.base_component.attr['title'] %> - SQLAlchemy Documentation
+% except KeyError:
+    SQLAlchemy Documentation
+%
+</%method>
 
 
 
index 32dd0d0c025403887911674d62fce08e54832e2d..49ca04bb277bf1703a523892f95146edab42f34e 100644 (file)
@@ -1,4 +1,5 @@
 <%flags>inherit='document_base.myt'</%flags>
+<%attr>title='Database Meta Data'</%attr>
 <&|doclib.myt:item, name="metadata", description="Database Meta Data" &>
     <&|doclib.myt:item, name="tables", description="Describing Tables with MetaData" &>
     <p>The core of SQLAlchemy's query and object mapping operations is table metadata, which are Python objects that describe tables.  Metadata objects can be created by explicitly naming the table and all its properties, using the Table, Column, ForeignKey, and Sequence objects imported from <span class="codeline">sqlalchemy.schema</span>, and a database engine constructed as described in the previous section, or they can be automatically pulled from an existing database schema.  First, the explicit version: </p>
index 209b3313b3806726a028e51b043ae44589f22cf2..0bec280830e4004944828bc07964fb4d6a0b61df 100644 (file)
@@ -1,4 +1,5 @@
 <%flags>inherit='document_base.myt'</%flags>
+<%attr>title='Connection Pooling'</%attr>
 <&|doclib.myt:item, name="pooling", description="Connection Pooling" &>
     <P><b>Note:</b>This section describes the connection pool module of SQLAlchemy, which is the smallest component of the library that can be used on its own.  If you are interested in using SQLAlchemy for query construction or Object Relational Mapping, this module is automatically managed behind the scenes; you can skip ahead to <&formatting.myt:link,path="dbengine"&> in that case.</p>
     <p>At the base of any database helper library is a system of efficiently acquiring connections to the database.  Since the establishment of a database connection is typically a somewhat expensive operation, an application needs a way to get at database connections repeatedly without incurring the full overhead each time.  Particularly for server-side web applications, a connection pool is the standard way to maintain a "pool" of database connections which are used over and over again among many requests.  Connection pools typically are configured to maintain a certain "size", which represents how many connections can be used simultaneously without resorting to creating more newly-established connections.
index 40460b362a3282a505eb2d9bb62fabdb54921a9b..146d7d843c545a22a2081652608f3cc4d93bba4d 100644 (file)
@@ -1,4 +1,5 @@
 <%flags>inherit='document_base.myt'</%flags>
+<%attr>title='Roadmap'</%attr>
 <&|doclib.myt:item, name="roadmap", description="Roadmap" &>
 <p>SQLAlchemy includes several components, each of which are useful by themselves to give varying levels of assistance to a database-enabled application.  Below is a roadmap of the "knowledge dependencies" between these components indicating the order in which concepts may be learned.  
 </p>
index d11bfdde7e7395e4f17fdb5bd711ea1dc1c2cfe5..ec81e44c5fc1a17fd2e0b3b50eb7567257a5f1d4 100644 (file)
@@ -1,4 +1,6 @@
 <%flags>inherit='document_base.myt'</%flags>
+<%attr>title='Constructing SQL Queries via Python Expressions'</%attr>
+
 <&|doclib.myt:item, name="sql", description="Constructing SQL Queries via Python Expressions" &>
     <p><b>Note:</b> This section describes how to use SQLAlchemy to construct SQL queries and receive result sets.  It does <b>not</b> cover the object relational mapping capabilities of SQLAlchemy; that is covered later on in <&formatting.myt:link, path="datamapping"&>.  However, both areas of functionality work similarly in how selection criterion is constructed, so if you are interested just in ORM, you should probably skim through basic <&formatting.myt:link, path="sql_select_whereclause"&> construction before moving on.</p>
     <p>Once you have used the <span class="codeline">sqlalchemy.schema</span> module to construct your tables and/or reflect them from the database, performing SQL queries using those table meta data objects is done via the <span class="codeline">sqlalchemy.sql</span> package.  This package defines a large set of classes, each of which represents a particular kind of lexical construct within a SQL query; all are descendants of the common base class <span class="codeline">sqlalchemy.sql.ClauseElement</span>.  A full query is represented via a structure of ClauseElements.  A set of reasonably intuitive creation functions is provided by the <span class="codeline">sqlalchemy.sql</span> package to create these structures; these functions are described in the rest of this section. </p>
index 6f4de361954628ec4115c990c47076dfc71e9cc7..d9d3cb141e1e3c8c610f281cf599d83a19a3eb91 100644 (file)
@@ -1,4 +1,6 @@
 <%flags>inherit='document_base.myt'</%flags>
+<%attr>title='The Types System'</%attr>
+
 <&|doclib.myt:item, name="types", description="The Types System" &>
 <p>The package <span class="codeline">sqlalchemy.types</span> defines the datatype identifiers which may be used when defining <&formatting.myt:link, path="metadata", text="table metadata"&>.  This package includes a set of generic types, a set of SQL-specific subclasses of those types, and a small extension system used by specific database connectors to adapt these generic types into database-specific type objects.
 </p>
index 71345393da61cb6b4a1ea5d5e5f89cf56048c417..d96e41ee4a65c3982c8d46a9ab8f675e3b15bd86 100644 (file)
@@ -1,4 +1,6 @@
 <%flags>inherit='document_base.myt'</%flags>
+<%attr>title='Unit of Work'</%attr>
+
 <&|doclib.myt:item, name="unitofwork", description="Unit of Work" &>
     <&|doclib.myt:item, name="overview", description="Overview" &>
     </&>