Package web2py :: Package gluon :: Module dal :: Class BaseAdapter
[hide private]
[frames] | no frames]

Class BaseAdapter

source code

    object --+    
             |    
ConnectionPool --+
                 |
                BaseAdapter
Known Subclasses:
NoSQLAdapter, MySQLAdapter, DB2Adapter, FireBirdAdapter, InformixAdapter, IngresAdapter, PostgreSQLAdapter, SQLiteAdapter, MSSQLAdapter, OracleAdapter, SAPDBAdapter

Instance Methods [hide private]
 
adapt(self, obj) source code
 
integrity_error(self) source code
 
operational_error(self) source code
 
file_exists(self, filename)
to be used ONLY for files that on GAE may not be on filesystem
source code
 
file_open(self, filename, mode='rb', lock=True)
to be used ONLY for files that on GAE may not be on filesystem
source code
 
file_close(self, fileobj, unlock=True)
to be used ONLY for files that on GAE may not be on filesystem
source code
 
file_delete(self, filename) source code
 
__init__(self, db, uri, pool_size=0, folder=global_settings.applications_parent, db_codec='UTF-8', credential_decoder=<function <lambda> at 0x104b320>, driver_args={}, adapter_args={})
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
sequence_name(self, tablename) source code
 
trigger_name(self, tablename) source code
 
create_table(self, table, migrate=True, fake_migrate=True, polymodel=global_settings.applications_parent) source code
 
migrate_table(self, table, sql_fields, sql_fields_old, sql_fields_aux, logfile, fake_migrate=True) source code
 
LOWER(self, first) source code
 
UPPER(self, first) source code
 
EXTRACT(self, first, what) source code
 
AGGREGATE(self, first, what) source code
 
JOIN(self) source code
 
LEFT_JOIN(self) source code
 
RANDOM(self) source code
 
NOT_NULL(self, default, field_type) source code
 
COALESCE(self, first, second) source code
 
COALESCE_ZERO(self, first) source code
 
RAW(self, first) source code
 
ALLOW_NULL(self) source code
 
SUBSTRING(self, field, parameters) source code
 
PRIMARY_KEY(self, key) source code
 
_drop(self, table, mode) source code
 
drop(self, table, mode='') source code
 
_insert(self, table, fields) source code
 
insert(self, table, fields) source code
 
bulk_insert(self, table, items) source code
 
NOT(self, first) source code
 
AND(self, first, second) source code
 
OR(self, first, second) source code
 
BELONGS(self, first, second) source code
 
LIKE(self, first, second) source code
 
STARTSWITH(self, first, second) source code
 
ENDSWITH(self, first, second) source code
 
CONTAINS(self, first, second) source code
 
EQ(self, first, second=global_settings.applications_parent) source code
 
NE(self, first, second=global_settings.applications_parent) source code
 
LT(self, first, second=global_settings.applications_parent) source code
 
LE(self, first, second=global_settings.applications_parent) source code
 
GT(self, first, second=global_settings.applications_parent) source code
 
GE(self, first, second=global_settings.applications_parent) source code
 
ADD(self, first, second) source code
 
SUB(self, first, second) source code
 
MUL(self, first, second) source code
 
DIV(self, first, second) source code
 
MOD(self, first, second) source code
 
AS(self, first, second) source code
 
ON(self, first, second) source code
 
INVERT(self, first) source code
 
COMMA(self, first, second) source code
 
expand(self, expression, field_type=global_settings.applications_parent) source code
 
alias(self, table, alias)
Given a table object, makes a new table object with alias name.
source code
 
_truncate(self, table, mode='') source code
 
truncate(self, table, mode=' ') source code
 
_update(self, tablename, query, fields) source code
 
update(self, tablename, query, fields) source code
 
_delete(self, tablename, query) source code
 
delete(self, tablename, query) source code
 
get_table(self, query) source code
 
_select(self, query, fields, attributes) source code
 
select_limitby(self, sql_s, sql_f, sql_t, sql_w, sql_o, limitby) source code
 
select(self, query, fields, attributes)
Always returns a Rows object, possibly empty.
source code
 
_count(self, query, distinct=global_settings.applications_parent) source code
 
count(self, query, distinct=global_settings.applications_parent) source code
 
tables(self, query) source code
 
commit(self) source code
 
rollback(self) source code
 
close(self) source code
 
distributed_transaction_begin(self, key) source code
 
prepare(self, key) source code
 
commit_prepared(self, key) source code
 
rollback_prepared(self, key) source code
 
concat_add(self, table) source code
 
constraint_name(self, table, fieldname) source code
 
create_sequence_and_triggers(self, query, table, **args) source code
 
log_execute(self, *a, **b) source code
 
execute(self, *a, **b) source code
 
represent(self, obj, fieldtype) source code
 
represent_exceptions(self, obj, fieldtype) source code
 
lastrowid(self, table) source code
 
integrity_error_class(self) source code
 
rowslice(self, rows, minimum=0, maximum=global_settings.applications_parent)
By default this function does nothing; overload when db does not do slicing.
source code
 
parse(self, rows, colnames, blob_decode=True) source code
 
common_filter(self, query, tablenames) source code

Inherited from ConnectionPool: find_or_make_work_folder, pool_connection

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Static Methods [hide private]

Inherited from ConnectionPool: close_all_instances, set_folder

Class Variables [hide private]
  driver = <web2py.gluon.custom_import._Web2pyImporter object at...
PyMySQL: A pure-Python drop-in replacement for MySQLdb.
  maxcharlength = 32768
  commit_on_alter_table = True
  support_distributed_transaction = True
  uploads_in_blob = True
  can_select_for_update = True
  types = {'blob': 'BLOB', 'boolean': 'CHAR(1)', 'date': 'DATE',...

Inherited from ConnectionPool: check_active_connection, pools

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, db, uri, pool_size=0, folder=global_settings.applications_parent, db_codec='UTF-8', credential_decoder=<function <lambda> at 0x104b320>, driver_args={}, adapter_args={})
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

Class Variable Details [hide private]

driver

PyMySQL: A pure-Python drop-in replacement for MySQLdb.

Copyright (c) 2010 PyMySQL contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Value:
global_settings.applications_parent

types

Value:
{'blob': 'BLOB',
 'boolean': 'CHAR(1)',
 'date': 'DATE',
 'datetime': 'TIMESTAMP',
 'decimal': 'DOUBLE',
 'double': 'DOUBLE',
 'id': 'INTEGER PRIMARY KEY AUTOINCREMENT',
 'integer': 'INTEGER',
...