本文整理汇总了Python中api_li3ds.database.Database.rowcount方法的典型用法代码示例。如果您正苦于以下问题:Python Database.rowcount方法的具体用法?Python Database.rowcount怎么用?Python Database.rowcount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类api_li3ds.database.Database
的用法示例。
在下文中一共展示了Database.rowcount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from api_li3ds.database import Database [as 别名]
# 或者: from api_li3ds.database.Database import rowcount [as 别名]
def post(self):
'''
Import foreign schema for a rosbag file
'''
req = sql.SQL("""
create schema if not exists {schema};
select coalesce(max(pcid) + 1, 1) as pcid from pointcloud_formats
""").format(schema=sql.Identifier(api.payload['schema']))
pcid = Database.query_asdict(req)[0]['pcid']
identifiers = {k: sql.Identifier(v) for k, v in api.payload.items()}
req = sql.SQL("""
import foreign schema {rosbag} limit to (pointcloud_formats)
from server {server} into {schema} options (pcid %(pcid)s);
insert into pointcloud_formats select pcid, srid, schema
from {schema}.pointcloud_formats;
import foreign schema {rosbag} except (pointcloud_formats)
from server {server} into {schema} options (pcid %(pcid)s)
""").format(**identifiers)
Database.rowcount(req, {'pcid': str(pcid)})
return "foreign schema imported", 201
示例2: delete
# 需要导入模块: from api_li3ds.database import Database [as 别名]
# 或者: from api_li3ds.database.Database import rowcount [as 别名]
def delete(self, id):
'''Delete a transformation given its identifier'''
res = Database.rowcount("delete from li3ds.transfo_tree where id=%s", (id,))
if not res:
nstft.abort(404, 'Transformation tree not found')
return '', 410
示例3: delete
# 需要导入模块: from api_li3ds.database import Database [as 别名]
# 或者: from api_li3ds.database.Database import rowcount [as 别名]
def delete(self, id):
'''Delete a sensor given its identifier'''
res = Database.rowcount("delete from li3ds.sensor where id=%s", (id,))
if not res:
nssensor.abort(404, 'Sensor not found')
return '', 410
示例4: delete
# 需要导入模块: from api_li3ds.database import Database [as 别名]
# 或者: from api_li3ds.database.Database import rowcount [as 别名]
def delete(self, id):
'''Delete a referential given its identifier'''
res = Database.rowcount("delete from li3ds.referential where id=%s", (id,))
if not res:
nsrf.abort(404, 'referential not found')
return '', 410
示例5: delete
# 需要导入模块: from api_li3ds.database import Database [as 别名]
# 或者: from api_li3ds.database.Database import rowcount [as 别名]
def delete(self, id):
'''Delete a platform given its identifier'''
res = Database.rowcount("delete from li3ds.platform where id=%s", (id,))
if not res:
nspfm.abort(404, 'Platform not found')
return '', 410