aircodelabs / Hydrogen

The serverless framework creates web servers that can run anywhere.

Home Page:https://aircode.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

关于数据库相关的问题

allmors opened this issue · comments

这个项目是必须依赖aircode云平台吗还是它是一个类似airecode云平台的开源?

数据库这块按照airecode文档执行的话

import aircode from 'aircode';

export default async function (params, context) {
  const dbs = aircode.db.table('persons');
  // Use `save` to add a new record
  const result = await dbs.save({
    name: 'Micheal',
    age: 28,
  });
  // const result = await dbs.where({ name: 'Micheal' }).find();

  return {
    result
  };
};

以上在hydroge中运行是访问api是没有任何信息的,数据是能正常在本地插入(如下图)
image
image

commented

这个项目是必须依赖aircode云平台吗还是它是一个类似airecode云平台的开源?

数据库这块按照airecode文档执行的话

import aircode from 'aircode';

export default async function (params, context) {
  const dbs = aircode.db.table('persons');
  // Use `save` to add a new record
  const result = await dbs.save({
    name: 'Micheal',
    age: 28,
  });
  // const result = await dbs.where({ name: 'Micheal' }).find();

  return {
    result
  };
};

以上在hydroge中运行是访问api是没有任何信息的,数据是能正常在本地插入(如下图) image image

hydrogen 可以运行在本地或者其他平台,也可以集成到 aircode,bug 已解决,感谢反馈。