-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy path__init__.py
More file actions
115 lines (103 loc) · 3.77 KB
/
__init__.py
File metadata and controls
115 lines (103 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Sets up shortcuts for imports from the library."""
import logging
from spanner_orm import api
from spanner_orm import condition
from spanner_orm import decorator
from spanner_orm import error
from spanner_orm import field
from spanner_orm import foreign_key_relationship
from spanner_orm import index
from spanner_orm import model
from spanner_orm import relationship
from spanner_orm import table_apis
from spanner_orm.admin import api as admin_api
from spanner_orm.admin import migration_executor
from spanner_orm.admin import update as update_module
# add NullHandler to root-module logger so that individual modules
# won't have to.
logging.getLogger(__name__).addHandler(logging.NullHandler())
# pylint: disable=invalid-name
SpannerConnection = api.SpannerConnection
SpannerError = error.SpannerError
SpannerApi = api.SpannerApi
connect = api.connect
from_connection = api.from_connection
hangup = api.hangup
spanner_api = api.spanner_api
SpannerAdminApi = admin_api.SpannerAdminApi
connect_admin = admin_api.connect
from_admin_connection = admin_api.from_connection
hangup_admin = admin_api.hangup
spanner_admin_api = admin_api.spanner_admin_api
find = table_apis.find
sql_query = table_apis.sql_query
delete = table_apis.delete
insert = table_apis.insert
update = table_apis.update
upsert = table_apis.upsert
Model = model.Model
Boolean = field.Boolean
Field = field.Field
Integer = field.Integer
Float = field.Float
ForeignKeyRelationship = foreign_key_relationship.ForeignKeyRelationship
Index = index.Index
Relationship = relationship.Relationship
String = field.String
StringArray = field.StringArray
Timestamp = field.Timestamp
BytesBase64 = field.BytesBase64
Array = field.Array
ArbitraryCondition = condition.ArbitraryCondition
Column = condition.Column
Condition = condition.Condition
ORDER_ASC = condition.OrderType.ASC
ORDER_DESC = condition.OrderType.DESC
Param = condition.Param
Segment = condition.Segment
columns_equal = condition.columns_equal
contains = condition.contains
equal_to = condition.equal_to
force_index = condition.force_index
force_null_filtered_index = condition.force_null_filtered_index
greater_than = condition.greater_than
greater_than_or_equal_to = condition.greater_than_or_equal_to
in_list = condition.in_list
includes = condition.includes
less_than = condition.less_than
less_than_or_equal_to = condition.less_than_or_equal_to
limit = condition.limit
not_equal_to = condition.not_equal_to
not_greater_than = condition.not_greater_than
not_in_list = condition.not_in_list
not_less_than = condition.not_less_than
or_ = condition.or_
order_by = condition.order_by
transactional_read = decorator.transactional_read
transactional_write = decorator.transactional_write
MigrationUpdate = update_module.MigrationUpdate
NoUpdate = update_module.NoUpdate
SchemaUpdate = update_module.SchemaUpdate
CreateTable = update_module.CreateTable
DropTable = update_module.DropTable
AddColumn = update_module.AddColumn
DropColumn = update_module.DropColumn
AlterColumn = update_module.AlterColumn
CreateIndex = update_module.CreateIndex
DropIndex = update_module.DropIndex
ExecutePartitionedDml = update_module.ExecutePartitionedDml
model_creation_ddl = update_module.model_creation_ddl
MigrationExecutor = migration_executor.MigrationExecutor