astrodatagui: StarsDB: add function to insert new star
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user