Skip to content
Permalink
Browse files
moved old methods of specdb to arch
  • Loading branch information
xperthunter committed May 2, 2022
1 parent 1d57efc commit b5f321a3aeff1b04f9dbdfbfe1b00460095864ab
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 37 deletions.
File renamed without changes.
@@ -113,7 +113,7 @@ def forms(table=None, num=None):
comment_split = line.split(' -- ')
comment = comment_split[-1]
form_dic[table_name] = ruamel.yaml.comments.CommentedMap()
form_dic.yaml_add_eol_comment(comment, table_name)
form_dic.yaml_add_eol_comment(comment, table_name, column=25)

elif re.search(r' -- ', line):
if table_name in table:
@@ -127,7 +127,7 @@ def forms(table=None, num=None):
form_dic[table_name][column] = SQL_TYPES[sql_type]
pad = 30 - len(column)
form_dic[table_name].yaml_add_eol_comment(
f"{' '*pad}{comment}", column)
comment, column, column=35)

yaml = ruamel.yaml.YAML()
yaml.preserve_quotes = True
@@ -238,6 +238,7 @@ def find_uniq_constraint(table=None, cursor=None):
sql = f"SELECT sql FROM sqlite_master WHERE type='table' AND name='{table}'"
cursor.execute(sql)
schema = cursor.fetchone()
print(schema)
entries = [ tmp.strip() for tmp in schema[0].splitlines()
if tmp.find("UNIQUE")>=0 ]

@@ -1538,6 +1539,7 @@ def backup(db=None, object_dir='objects', backup_file='backup.txt'):

return True


def restore(backup=None, backup_file=None, object_dir=None):
"""
This function performs the restore function from an incremental backup
@@ -1574,38 +1576,3 @@ def restore(backup=None, backup_file=None, object_dir=None):

# Restoration is complete
return True



































Binary file not shown.
Binary file not shown.

0 comments on commit b5f321a

Please sign in to comment.