首页 技术 正文
技术 2022年11月19日
0 收藏 563 点赞 3,208 浏览 1061 个字

实际上因为pipelinedb 是原生支持pg的,所以应该不存在太大的问题,以下为测试

使用doker-compose 运行

配置

  • docker-compose 文件
version: '3.6'
services:
postgres:
image: tkanos/pipelinedb_kafka
ports:
- "5432:5432"
graphql-engine:
image: hasura/graphql-engine:v1.0.0-alpha06
ports:
- "8080:8080"
depends_on:
- "postgres"
environment:
- "POSTGRES_PASSWORD:pipeline"
command: >
/bin/sh -c "
graphql-engine --database-url postgres://pipeline:pipeline@postgres:5432/pipeline serve --enable-console;
"
volumes:
db_data:
  • 说明
    主要是进行pipelinedb 的添加以及graphql-engine 的连接pg的配置

启动&&运行

  • 启动
docker-compose up -d
  • 效果
    hasura  graphql  集成pipelinedb测试

添加pipelinedb 数据

stream 操作

  • 创建stream
CREATE STREAM stream_test1 (x integer, y integer,z text);
  • 创建 CONTINUOUS
CREATE CONTINUOUS VIEW v_sum as select sum( x + y ) FROM stream_test1;
CREATE CONTINUOUS VIEW V_GROUP AS SELECT count(*) as coun,x,y,z FROM stream_test1 GROUP BY x,y,z;
  • 插入数据
INSERT INTO stream_test1(x,y,z) VALUES(1,2,'A'),(3,4,'B'),(5,6,'C'),(7,8,'D'),(1,2,'A');
  • 查询
select * from v_sum;
select * from v_group;

添加graphql table

  • 查看pipelinedb 系统创建的表
    hasura  graphql  集成pipelinedb测试
  • 添加 graphql 支持
    hasura  graphql  集成pipelinedb测试
  • 数据查询
    hasura  graphql  集成pipelinedb测试

说明

结合起来使用还是很方便的,即有hasura引擎的简单,同时集成了pipelinedb的stream 特性,很好很强大

参考资料

https://github.com/hasura/graphql-engine
http://docs.pipelinedb.com/installation.html

    

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,964
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,486
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,331
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,114
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,747
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,781