我有使用部分SQL和ion文档将数据插入AWS QLDB的代码。现在想update
QLDB内的文档,而我找不到任何示例。请帮助!
statement = 'INSERT INTO MY_TABLE'
ion_documents = loads(dumps(MY_JSON_DATA))
def query_lambda(tx_executor, query=statement, docs=ion_documents):
return tx_executor.execute_statement(query, [docs])
def retry_lambda():
print ('Retrying')
cursor = session.execute_lambda(query_lambda, retry_lambda)
该文档有一个Python教程,其中包含更新文档的示例:https://docs.aws.amazon.com/qldb/latest/developerguide/getting-started.python.step-5.html。
这是有关PartiQL更新语句的一些信息:https://docs.aws.amazon.com/qldb/latest/developerguide/ql-reference.update.html