From 1bab21652510b01c0df07cc58ce029bc8cdf7f9c Mon Sep 17 00:00:00 2001 From: slomek Date: Sat, 5 Dec 2015 20:21:44 +0100 Subject: [PATCH] Create db only if doesn't exist yet --- influxdb/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/influxdb/client.py b/influxdb/client.py index b9fcb0c3..99a88720 100644 --- a/influxdb/client.py +++ b/influxdb/client.py @@ -460,7 +460,7 @@ def create_database(self, dbname): :param dbname: the name of the database to create :type dbname: str """ - self.query("CREATE DATABASE \"%s\"" % dbname) + self.query("CREATE DATABASE IF NOT EXISTS \"%s\"" % dbname) def drop_database(self, dbname): """Drop a database from InfluxDB.