首页 > 解决方案 > 连接飞镖和 postgresSQL

问题描述

我正在尝试从我的颤振应用程序连接到 PostgreSQL 数据库。

void dbConnect(List<String> arguments) async {
    final conn = PostgreSQLConnection(
      '10.0.2.2',
      5432,
      'tea_leaf_system_database',
      username: 'postgres',
      password: 'root',
    );
    await conn.open();
    print('Connected to Postgres database...');
    await conn.query('''
    
    ''');
    await conn.close();
}

这是我使用的示例,它有效。有人可以指导我锻炼登录场景吗?(使用数据库的值对表单中输入的值进行身份验证,如果用户通过身份验证则登录?)

标签: postgresqlflutter

解决方案


推荐阅读