Skip to content Skip to sidebar Skip to footer

How To Check If Database Already Exists

I am writing a small Python program that loads some documents into couchdb. It would be very convenient to check whether a database with a certain name already exists, so I can ei

Solution 1:

The easiest way I can think is:

import couchdb
server = couchdb.Server("http://localhost:5984")
"dataBaseName" in server

Return True if a database with the name exists, False otherwise

https://github.com/djc/couchdb-python/blob/master/couchdb/client.py#L90-L101


Post a Comment for "How To Check If Database Already Exists"