本文整理匯總了Python中arangodb.api.Database.create方法的典型用法代碼示例。如果您正苦於以下問題:Python Database.create方法的具體用法?Python Database.create怎麽用?Python Database.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類arangodb.api.Database
的用法示例。
在下文中一共展示了Database.create方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setUp
# 需要導入模塊: from arangodb.api import Database [as 別名]
# 或者: from arangodb.api.Database import create [as 別名]
def setUp(self):
self.database_name = 'testcase_index_222_123'
self.db = Database.create(name=self.database_name)
self.operating_collection = 'bar_extra'
self.test_1_col = Collection.create(name=self.operating_collection)
示例2: setUp
# 需要導入模塊: from arangodb.api import Database [as 別名]
# 或者: from arangodb.api.Database import create [as 別名]
def setUp(self):
self.database_name = 'testcase_aqlquery_123'
self.db = Database.create(name=self.database_name)
self.test_1_col = self.db.create_collection('foo_1')
self.test_2_col = self.db.create_collection('foo_2')
self.col1_doc1 = self.test_1_col.create_document()
self.col1_doc1.little_number = 33
self.col1_doc1.loved = False
self.col1_doc1.small_text = "lll aa"
self.col1_doc1.save()
self.col1_doc2 = self.test_1_col.create_document()
self.col1_doc2.little_number = 1
self.col1_doc2.loved = False
self.col1_doc2.small_text = "aaa aa"
self.col1_doc2.save()
self.col1_doc3 = self.test_1_col.create_document()
self.col1_doc3.little_number = 3
self.col1_doc3.loved = True
self.col1_doc3.small_text = "xxx tt"
self.col1_doc3.save()
self.col2_doc1 = self.test_2_col.create_document()
self.col2_doc1.little_number = 33
self.col2_doc1.loved = False
self.col2_doc1.save()
self.col2_doc2 = self.test_2_col.create_document()
self.col2_doc2.little_number = 11
self.col2_doc2.loved = True
self.col2_doc2.save()
示例3: test_create_and_delete_database
# 需要導入模塊: from arangodb.api import Database [as 別名]
# 或者: from arangodb.api.Database import create [as 別名]
def test_create_and_delete_database(self):
database_name = 'test_foo_123'
db = Database.create(name=database_name)
self.assertIsNotNone(db)
Database.remove(name=database_name)
示例4: setUp
# 需要導入模塊: from arangodb.api import Database [as 別名]
# 或者: from arangodb.api.Database import create [as 別名]
def setUp(self):
self.database_name = 'testcase_int_abc'
self.collection1_name = 'int32_collection_abc'
self.collection2_name = 'int64_collection_xyz'
self.coll3_name = 'dec10_coll_123'
self.coll4_name = 'dec20_col2_456'
self.db = Database.create(name=self.database_name)
self.col1 = self.db.create_collection(self.collection1_name)
self.col2 = self.db.create_collection(self.collection2_name)
self.col3 = self.db.create_collection(self.coll3_name)
self.col4 = self.db.create_collection(self.coll4_name)
示例5: setUp
# 需要導入模塊: from arangodb.api import Database [as 別名]
# 或者: from arangodb.api.Database import create [as 別名]
def setUp(self):
self.database_name = 'testcase_simple_query_123'
self.db = Database.create(name=self.database_name)
# Create test data
self.test_1_col = self.db.create_collection('foo_1')
self.test_2_col = self.db.create_collection('foo_2')
self.col1_doc1 = self.test_1_col.create_document()
self.col1_doc1.ta='fa'
self.col1_doc1.bla='aaa'
self.col1_doc1.save()
self.col1_doc2 = self.test_1_col.create_document()
self.col1_doc2.ta='fa'
self.col1_doc2.bla='xxx'
self.col1_doc2.save()
self.col2_doc1 = self.test_2_col.create_document()
self.col2_doc1.save()
示例6: setUp
# 需要導入模塊: from arangodb.api import Database [as 別名]
# 或者: from arangodb.api.Database import create [as 別名]
def setUp(self):
self.database_name = 'testcase_collection_model_123'
self.db = Database.create(name=self.database_name)
示例7: Client
# 需要導入模塊: from arangodb.api import Database [as 別名]
# 或者: from arangodb.api.Database import create [as 別名]
##################################
# These tests
##################################
# Init client
from arangodb.query.advanced import Query
from arangodb.query.simple import SimpleQuery
client = Client('arango.nix.bra')
# Create database in which all collections are created
database_name = 'arangopy_speed_test_database'
try:
Database.create(database_name)
except:
client.set_database(database_name)
timer = timeit.default_timer
def timer_decorator(message):
def outer_wrapper(func):
def wrapper(*args, **kwargs):
start = timer()
func(*args, **kwargs)
elapsed = timer() - start
print(message % elapsed)
return wrapper