annotate PerfsDb/DbType.py @ 403:e08e15befa0c

test sync POST to /archive
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 02 Jun 2021 17:42:20 +0200
parents df1f9946571c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
156
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
1 from enum import Enum
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
2
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
3 class DbType(Enum):
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
4 Sqlite = 1
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
5 PG9 = 2
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
6 MySQL = 3
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
7 MSSQL = 4
f1a75985caa8 first Db test framework - work in progress
am@osimis.io
parents:
diff changeset
8 PG10 = 5
158
df1f9946571c perfs db continued: tests working with tiny DBs on all setup but the sqliteplugin
am@osimis.io
parents: 156
diff changeset
9 PG11 = 5
df1f9946571c perfs db continued: tests working with tiny DBs on all setup but the sqliteplugin
am@osimis.io
parents: 156
diff changeset
10 SqlitePlugin = 6
df1f9946571c perfs db continued: tests working with tiny DBs on all setup but the sqliteplugin
am@osimis.io
parents: 156
diff changeset
11
df1f9946571c perfs db continued: tests working with tiny DBs on all setup but the sqliteplugin
am@osimis.io
parents: 156
diff changeset
12 def isPG(self):
df1f9946571c perfs db continued: tests working with tiny DBs on all setup but the sqliteplugin
am@osimis.io
parents: 156
diff changeset
13 return self.value in [DbType.PG9.value, DbType.PG10.value, DbType.PG11.value]
df1f9946571c perfs db continued: tests working with tiny DBs on all setup but the sqliteplugin
am@osimis.io
parents: 156
diff changeset
14
df1f9946571c perfs db continued: tests working with tiny DBs on all setup but the sqliteplugin
am@osimis.io
parents: 156
diff changeset
15 def isSqlite(self):
df1f9946571c perfs db continued: tests working with tiny DBs on all setup but the sqliteplugin
am@osimis.io
parents: 156
diff changeset
16 return self.value in [DbType.Sqlite.value, DbType.SqlitePlugin.value]
df1f9946571c perfs db continued: tests working with tiny DBs on all setup but the sqliteplugin
am@osimis.io
parents: 156
diff changeset
17
df1f9946571c perfs db continued: tests working with tiny DBs on all setup but the sqliteplugin
am@osimis.io
parents: 156
diff changeset
18 def isServer(self):
df1f9946571c perfs db continued: tests working with tiny DBs on all setup but the sqliteplugin
am@osimis.io
parents: 156
diff changeset
19 return not self.isSqlite()