首页 > 数据库 > > prisma 集成 pipelinedb测试
pipelinedb 是一个基于pg数据库开发的stream sql 数据库,和prisma 集成起来可以开发很
方便的stream 应用
使用docker 安装
注意选择数据库类型为pg
prisma init version: '3'
services:
prisma:
image: prismagraphql/prisma:1.13
restart: always
ports:
- "4466:4466"
environment:
PRISMA_CONFIG: |
port: 4466
# uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
# managementApiSecret: my-secret
databases:
default:
connector: postgres
host: pipelinedb
port: 5432
user: pipeline
password: pipeline
migrations: true
pipelinedb:
image: tkanos/pipelinedb_kafka
ports:
- "5432:5432"需要添加prisma 数据库,可以通过pg 客户端进行创建,用户密码 pipeline pipelinedocker-compose up -dprisma deployschema
query 
mutation
数据库 
CREATE STREAM stream_test1 (x integer, y integer,z text);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;

pipelinedb 的stream 特性是一个很不错的功能,实际上集成hasura 的graphql 引擎可能会更方便,后边会有相关的测试集成
https://www.pipelinedb.com/
https://github.com/rongfengliang/prisma-pipelinedb-demo
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69946831/viewspace-3130068/ ,如需转载,请注明出处,否则将追究法律责任。