代码拉取完成,页面将自动刷新
Realtime GraphQL on PostgreSQL / MySQL
This project exposes PostgreSQL / MySQL through GraphQL API, with built-in authorization engine. Inspired by Hasura.
This is alpha-version, with some features still in development:
module: fastgql-example
CREATE TABLE addresses(
id INT PRIMARY KEY,
street VARCHAR(255)
);
CREATE TABLE customers(
id INT PRIMARY KEY,
name VARCHAR(255),
address INT REFERENCES addresses(id)
);
INSERT INTO addresses VALUES (0, 'Danes Hill');
INSERT INTO addresses VALUES (1, 'Rangewood Road');
INSERT INTO customers VALUES (0, 'Stacey', 0);
INSERT INTO customers VALUES (1, 'John', 0);
INSERT INTO customers VALUES (2, 'Daniele', 1);
CREATE TABLE `test` (
`id` INT AUTO_INCREMENT NOT NULL,
`name` VARCHAR(50) NULL DEFAULT NULL ,
`age` INT NULL DEFAULT NULL ,
`create_time` TIMESTAMP NULL DEFAULT current_timestamp() ,
`update_time` TIMESTAMP NULL DEFAULT NULL ,
CONSTRAINT `PRIMARY` PRIMARY KEY (`id`)
);
INSERT INTO `test` (`id`, `name`, `age`, `create_time`, `update_time`) VALUES (1, 'test', 111, '2021-07-24T01:09:42.000Z', NULL);
INSERT INTO `test` (`id`, `name`, `age`, `create_time`, `update_time`) VALUES (2, 'test2', 111, '2021-07-24T01:09:42.000Z', NULL);
INSERT INTO `test` (`id`, `name`, `age`, `create_time`, `update_time`) VALUES (3, 'test3', 111, '2021-07-24T01:09:42.000Z', NULL);
CREATE TABLE `t_user` (
`id` INT AUTO_INCREMENT NOT NULL,
`name` VARCHAR(50) NULL DEFAULT NULL ,
`password` VARCHAR(100) NULL DEFAULT NULL ,
`create_time` DATETIME NULL DEFAULT NULL ,
`test_id` INT NULL DEFAULT NULL ,
CONSTRAINT `PRIMARY` PRIMARY KEY (`id`)
);
INSERT INTO `t_user` (`id`, `name`, `password`, `create_time`, `test_id`) VALUES (1, 'user', 'password', NULL, 2);
INSERT INTO `t_user` (`id`, `name`, `password`, `create_time`, `test_id`) VALUES (2, 'test', 'password', NULL, 2);
INSERT INTO `t_user` (`id`, `name`, `password`, `create_time`, `test_id`) VALUES (13, 'test', 'password', NULL, 2);
Start Postgres container:
Start FastGQL in dev mode with hot reload:
Go to GraphQL Playground or query localhost:8888/graphql
Build production bundle:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。