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

Class GoogleDatastoreAdapter

source code

    object --+            
             |            
ConnectionPool --+        
                 |        
       BaseAdapter --+    
                     |    
          NoSQLAdapter --+
                         |
                        GoogleDatastoreAdapter

Instance Methods [hide private]
 
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)
to be used ONLY for files that on GAE may not be on filesystem
source code
 
__init__(self, db, uri, pool_size=0, folder=None, db_codec='UTF-8', credential_decoder=<function IDENTITY at 0x10f5fc5f0>, driver_args={}, adapter_args={}, do_connect=True)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
parse_id(self, value, field_type) source code
 
create_table(self, table, migrate=True, fake_migrate=False, polymodel=None) source code
 
expand(self, expression, field_type=None) source code
 
AND(self, first, second) source code
 
EQ(self, first, second=None) source code
 
NE(self, first, second=None) source code
 
LT(self, first, second=None) source code
 
LE(self, first, second=None) source code
 
GT(self, first, second=None) source code
 
GE(self, first, second=None) source code
 
INVERT(self, first) source code
 
COMMA(self, first, second) source code
 
BELONGS(self, first, second=None) source code
 
CONTAINS(self, first, second) source code
 
NOT(self, first) source code
 
truncate(self, table, mode) source code
 
select_raw(self, query, fields=None, attributes=None) source code
 
select(self, query, fields, attributes)
This is the GAE version of select.
source code
 
count(self, query, distinct=None, limit=None) source code
 
delete(self, tablename, query)
This function was changed on 2010-05-04 because according to http://code.google.com/p/googleappengine/issues/detail?id=3119 GAE no longer supports deleting more than 1000 records.
source code
 
update(self, tablename, query, update_fields) source code
 
insert(self, table, fields) source code
 
bulk_insert(self, table, items) source code

Inherited from NoSQLAdapter: ADD, AGGREGATE, AS, DIV, ENDSWITH, EXTRACT, ILIKE, LEFT_JOIN, LOWER, MUL, ON, OR, PRIMARY_KEY, RANDOM, STARTSWITH, SUB, SUBSTRING, UPPER, alias, close_connection, commit, commit_prepared, concat_add, constraint_name, create_sequence_and_triggers, distributed_transaction_begin, drop, execute, id_query, integrity_error_class, lastrowid, log_execute, migrate_table, prepare, represent, represent_exceptions, rollback, rollback_prepared, rowslice

Inherited from NoSQLAdapter (private): _count, _delete, _insert, _select, _update

Inherited from BaseAdapter: ALLOW_NULL, CASE, COALESCE, COALESCE_ZERO, COUNT, EPOCH, JOIN, LIKE, MOD, NOT_NULL, RAW, REGEXP, adapt, build_parsemap, common_filter, expand_all, file_delete, find_driver, get_table, integrity_error, operational_error, parse, parse_blob, parse_boolean, parse_date, parse_datetime, parse_decimal, parse_double, parse_integer, parse_list_integers, parse_list_references, parse_list_strings, parse_reference, parse_time, parse_value, select_limitby, sequence_name, smart_adapt, tables, trigger_name, varquote

Inherited from BaseAdapter (private): _drop, _fetchall, _select_aux, _truncate

Inherited from ConnectionPool: after_connection, close, find_or_make_work_folder, reconnect

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

Static Methods [hide private]

Inherited from NoSQLAdapter: to_unicode

Inherited from ConnectionPool: close_all_instances, set_folder

Class Variables [hide private]
  uploads_in_blob = True
  types = {}
  REGEX_NAMESPACE = re.compile(r'.*://(?P<namespace>.+)')

Inherited from NoSQLAdapter: can_select_for_update

Inherited from BaseAdapter: FALSE, TRUE, commit_on_alter_table, connection, driver, driver_name, drivers, maxcharlength, support_distributed_transaction

Inherited from ConnectionPool: POOLS, check_active_connection

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

file_exists(self, filename)

source code 

to be used ONLY for files that on GAE may not be on filesystem

Overrides: BaseAdapter.file_exists
(inherited documentation)

file_open(self, filename, mode='rb', lock=True)

source code 

to be used ONLY for files that on GAE may not be on filesystem

Overrides: BaseAdapter.file_open
(inherited documentation)

file_close(self, fileobj)

source code 

to be used ONLY for files that on GAE may not be on filesystem

Overrides: BaseAdapter.file_close
(inherited documentation)

__init__(self, db, uri, pool_size=0, folder=None, db_codec='UTF-8', credential_decoder=<function IDENTITY at 0x10f5fc5f0>, driver_args={}, adapter_args={}, do_connect=True)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

parse_id(self, value, field_type)

source code 
Overrides: BaseAdapter.parse_id

create_table(self, table, migrate=True, fake_migrate=False, polymodel=None)

source code 
Overrides: BaseAdapter.create_table

expand(self, expression, field_type=None)

source code 
Overrides: BaseAdapter.expand

AND(self, first, second)

source code 
Overrides: BaseAdapter.AND

EQ(self, first, second=None)

source code 
Overrides: BaseAdapter.EQ

NE(self, first, second=None)

source code 
Overrides: BaseAdapter.NE

LT(self, first, second=None)

source code 
Overrides: BaseAdapter.LT

LE(self, first, second=None)

source code 
Overrides: BaseAdapter.LE

GT(self, first, second=None)

source code 
Overrides: BaseAdapter.GT

GE(self, first, second=None)

source code 
Overrides: BaseAdapter.GE

INVERT(self, first)

source code 
Overrides: BaseAdapter.INVERT

COMMA(self, first, second)

source code 
Overrides: BaseAdapter.COMMA

BELONGS(self, first, second=None)

source code 
Overrides: BaseAdapter.BELONGS

CONTAINS(self, first, second)

source code 
Overrides: BaseAdapter.CONTAINS

NOT(self, first)

source code 
Overrides: BaseAdapter.NOT

truncate(self, table, mode)

source code 
Overrides: BaseAdapter.truncate

select(self, query, fields, attributes)

source code 

This is the GAE version of select. some notes to consider:

  • db['_lastsql'] is not set because there is not SQL statement string for a GAE query
  • 'nativeRef' is a magical fieldname used for self references on GAE
  • optional attribute 'projection' when set to True will trigger use of the GAE projection queries. note that there are rules for what is accepted imposed by GAE: each field must be indexed, projection queries cannot contain blob or text fields, and you cannot use == and also select that same field. see https://developers.google.com/appengine/docs/python/datastore/queries#Query_Projection
  • optional attribute 'reusecursor' allows use of cursor with queries that have the limitby attribute. Set the attribute to True for the first query, set it to the value of db['_lastcursor'] to continue a previous query. The user must save the cursor value between requests, and the filters must be identical. It is up to the user to follow google's limitations: https://developers.google.com/appengine/docs/python/datastore/queries#Query_Cursors
Overrides: BaseAdapter.select

count(self, query, distinct=None, limit=None)

source code 
Overrides: BaseAdapter.count

delete(self, tablename, query)

source code 

This function was changed on 2010-05-04 because according to http://code.google.com/p/googleappengine/issues/detail?id=3119 GAE no longer supports deleting more than 1000 records.

Overrides: BaseAdapter.delete

update(self, tablename, query, update_fields)

source code 
Overrides: BaseAdapter.update

insert(self, table, fields)

source code 
Overrides: BaseAdapter.insert

bulk_insert(self, table, items)

source code 
Overrides: BaseAdapter.bulk_insert