當前位置: 首頁>>代碼示例>>Python>>正文


Python api.Database類代碼示例

本文整理匯總了Python中arangodb.api.Database的典型用法代碼示例。如果您正苦於以下問題:Python Database類的具體用法?Python Database怎麽用?Python Database使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Database類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_create_and_delete_database

    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)
開發者ID:garym,項目名稱:ArangoPy,代碼行數:9,代碼來源:tests.py

示例2: tearDown

    def tearDown(self):
        # Delete index
        self.geo_index.delete()
        self.hash_index.delete()
        self.fulltext_index.delete()
        self.skiplist_index.delete()

        # They need to be deleted
        Collection.remove(name=self.test_1_col.name)

        Database.remove(name=self.database_name)
開發者ID:garym,項目名稱:ArangoPy,代碼行數:11,代碼來源:tests.py

示例3: test_get_all_databases

    def test_get_all_databases(self):
        databases = Database.get_all()

        self.assertTrue(len(databases) >= 1)

        for db in databases:
            self.assertTrue(isinstance(db, Database))
開發者ID:garym,項目名稱:ArangoPy,代碼行數:7,代碼來源:tests.py

示例4: setUp

    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)
開發者ID:garym,項目名稱:ArangoPy,代碼行數:7,代碼來源:tests.py

示例5: setUp

    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()
開發者ID:saeschdivara,項目名稱:ArangoPy,代碼行數:34,代碼來源:escaping.py

示例6: setUp

    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)
開發者ID:morsdatum,項目名稱:ArangoPy,代碼行數:11,代碼來源:integerdoc.py

示例7: setUp

    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()
開發者ID:morsdatum,項目名稱:ArangoPy,代碼行數:20,代碼來源:basic.py

示例8: tearDown

    def tearDown(self):
	Collection.remove(name=self.collection1_name)
	Collection.remove(name=self.collection2_name)
	Collection.remove(name=self.coll3_name)
	Collection.remove(name=self.coll4_name)
	Database.remove(name=self.database_name)
開發者ID:morsdatum,項目名稱:ArangoPy,代碼行數:6,代碼來源:integerdoc.py

示例9: tearDown

    def tearDown(self):
        # They need to be deleted
        Collection.remove(name=self.test_1_col.name)
        Collection.remove(name=self.test_2_col.name)

        Database.remove(name=self.database_name)
開發者ID:saeschdivara,項目名稱:ArangoPy,代碼行數:6,代碼來源:escaping.py

示例10: tearDown

 def tearDown(self):
     Collection.remove(name=self.operating_collection)
     Database.remove(name=self.database_name)
開發者ID:morsdatum,項目名稱:ArangoPy,代碼行數:3,代碼來源:transaction.py

示例11: setUp

 def setUp(self):
     self.database_name = 'test_case_list_field_123'
     self.db = Database.create(name=self.database_name)
開發者ID:morsdatum,項目名稱:ArangoPy,代碼行數:3,代碼來源:list_field.py

示例12: Client


##################################
# 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
開發者ID:morsdatum,項目名稱:ArangoPy,代碼行數:29,代碼來源:arangopy-speed-tests.py

示例13: tearDown

 def tearDown(self):
     Database.remove(name=self.database_name)
開發者ID:morsdatum,項目名稱:ArangoPy,代碼行數:2,代碼來源:model.py


注:本文中的arangodb.api.Database類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。