【问题标题】:Cassandra - auto generate client query libraries in multiple languages given a cqlsh plain text query stringCassandra - 给定 cqlsh 纯文本查询字符串,自动生成多种语言的客户端查询库
【发布时间】:2019-02-01 04:52:12
【问题描述】:

我希望能够在给定 cqlsh "INSERT" 声明的情况下自动生成多种语言的客户端代码

例如,如果我有一个“INSERT”语句,例如:

INSERT INTO MY_TABLE(C1,C2) VALUES (?,?);

我将能够针对这个确切的查询生成多种语言的类型安全客户端“SELECT

这可能吗?

【问题讨论】:

    标签: cassandra code-generation cqlsh type-safety


    【解决方案1】:

    只有将它与表定义等结合起来才能实现真正的类型安全。但是目前还没有这样的工具......

    几乎所有语言的代码结构都非常相似(伪代码):

    // somewhere at beginning, only once
    prepStatement = session.prepare(query)
    // later in the code
    boundStatement = prepStatement.bind(parameters)
    session.execute(boundStatement)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-06-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-27
      • 1970-01-01
      • 2021-02-24
      相关资源
      最近更新 更多