本文整理汇总了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