-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSqliteDatabase.py
More file actions
33 lines (31 loc) · 1.71 KB
/
Copy pathSqliteDatabase.py
File metadata and controls
33 lines (31 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#--------------------------------------------------------------------------------------
#
# $Source: CommonTasks/SqliteDatabase.py $
#
# $Copyright: (c) 2018 Bentley Systems, Incorporated. All rights reserved. $
#
#--------------------------------------------------------------------------------------
import os
import re
import sqlite3
#-------------------------------------------------------------------------------------------
# bsiclass Ridha.Malik 01/2018
#-------------------------------------------------------------------------------------------
class Database:
#----------------------------------------------------------------------------------------
# bsimethod Ridha.Malik 01/2018
#----------------------------------------------------------------------------------------
def __init__(self, databasename):
self.databasename=databasename
#----------------------------------------------------------------------------------------
# bsimethod Ridha.Malik 01/2018
#----------------------------------------------------------------------------------------
def connectDatabase(self):
self.connnection = sqlite3.connect(self.databasename)
self.cursor = self.connnection.cursor()
#----------------------------------------------------------------------------------------
# bsimethod Ridha.Malik 01/2018
#----------------------------------------------------------------------------------------
def saveChanges(self):
self.connnection.commit()
self.connnection.close()