当前位置: 首页>>代码示例>>Python>>正文


Python Database.rowcount方法代码示例

本文整理汇总了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
开发者ID:LI3DS,项目名称:lids-api,代码行数:27,代码来源:foreignpc.py

示例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
开发者ID:LI3DS,项目名称:lids-api,代码行数:8,代码来源:transfotree.py

示例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
开发者ID:LI3DS,项目名称:lids-api,代码行数:8,代码来源:sensor.py

示例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
开发者ID:LI3DS,项目名称:lids-api,代码行数:8,代码来源:referential.py

示例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
开发者ID:LI3DS,项目名称:lids-api,代码行数:8,代码来源:platform.py


注:本文中的api_li3ds.database.Database.rowcount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。