astrodatagui: StarsDB: add function to insert new star

This commit is contained in:
2024-03-08 11:47:27 +01:00
parent cdb0c61b1a
commit 4bf5ddc9ba
+13
View File
@@ -91,3 +91,16 @@ class StarDB():
self.dbCursor.execute(f"""INSERT OR IGNORE INTO
starnames(mainName, altName)
VALUES(\"{mainName}\", \"{an["ID"]}\")""")
def insertStar(self, mainName: str, altNames, productManifest):
self.insertStarAlternativeNames(mainName, altNames)
for pm in productManifest:
file = pm["Local Path"]
source = pm["source"]
sequence = pm["sector"]
self.dbCursor.execute(f"""INSERT OR IGNORE INTO
stars(mainName, sourceName, sequence, filename)
VALUES(\"{mainName}\", \"{source}\", {sequence}, \"{file}\")""")
self.connection.commit()