简体   繁体   English

安全使用Dart SQLJocky

[英]Secure Use of Dart SQLJocky

I'm currently building a Dart application which needs to store SQL data in a centralised database. 我目前正在构建一个Dart应用程序,该应用程序需要在集中式数据库中存储SQL数据。 Normally I would do this via an ajax call to a PHP script (or REST service). 通常,我会通过对PHP脚本(或REST服务)的ajax调用来做到这一点。 I am keen however to keep this project as pure Dart language. 但是,我希望将这个项目保留为纯Dart语言。

I've found a library called SQLJocky (details here: http://pub.dartlang.org/packages/sqljocky ) but since Dart is a client side scripting language I am concerned about putting my database connection details on public display. 我已经找到了一个名为SQLJocky的库(详细信息在这里: http ://pub.dartlang.org/packages/sqljocky),但是由于Dart是一种客户端脚本语言,所以我担心将数据库连接详细信息公开显示。

var pool = new ConnectionPool(host: 'localhost', port: 3306, user: 'bob', password: 'wibble', db: 'stuff', max: 5);

This seems to be targeted at people looking to build SQL Clients where the user enters the connection details. 这似乎针对希望在用户输入连接详细信息的情况下构建SQL Client的人员。

My question is - can this library be used without disclosing the SQL connection details and if so, how? 我的问题是-可以在不公开SQL连接详细信息的情况下使用该库吗? Even if it's a programming trick to hide the correct details... 即使隐藏正确的细节是一个编程技巧...

This library won't run in the browser. 该库不会在浏览器中运行。
You can use Dart also on the server (without building to JavaScript). 您也可以在服务器上使用Dart(无需构建JavaScript)。
SqlJocky is for such server applications. SqlJocky用于此类服务器应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM