Skip to content

Instantly share code, notes, and snippets.

@kurorido
kurorido / preparePostgreSQL.dart
Created June 30, 2014 10:56
insert 1M records into postgresSQL
void preparePostgreSQL() {
print("Testing Insert into postgresql...");
var uri = 'postgres://name:[email protected]:5432/mydb';
connect(uri).then((conn) {
//conn.execute("create table data (id int, name text, description text, PRIMARY KEY(id)); ").whenComplete(() {
// conn.close();
//});
int startTime = new DateTime.now().millisecondsSinceEpoch;
List<Future> futures = new List();
String sql = "";
@kurorido
kurorido / testQueryCouchBaseWithViewAndStaleFalse.dart
Last active August 29, 2015 14:03
test Query CouchBase With View And Stale False
void testQueryCouchBaseWithViewAndStaleFalse() {
print("Testing Query CouchBase with View...");
CouchClient _dbclient;
CouchClient.connect([Uri.parse("http://10.1.4.112:8091/pools")], "default", "").then((CouchClient c) {
_dbclient = c;
}).then((_) {
@kurorido
kurorido / queryCouchBaseWithoutView.dart
Last active August 29, 2015 14:03
Test Query CouchBase Without View
void testQueryCouchBaseWithoutView() {
print("Testing Query CouchBase without View...");
CouchClient _dbclient;
CouchClient.connect([Uri.parse("http://10.1.4.112:8091/pools")], "default", "").then((CouchClient c) {
_dbclient = c;
}).then((_) {
@kurorido
kurorido / prepareDB.dart
Last active August 29, 2015 14:03
Insert 1M records into Couchbase
void prepareCouchBase() {
print("Testing Insert CouchBase");
CouchClient _dbclient;
CouchClient.connect([Uri.parse("http://10.1.4.112:8091/pools")], "default", "").then((CouchClient c) {
_dbclient = c;
}).then((_) {
int startTime = new DateTime.now().millisecondsSinceEpoch;
@kurorido
kurorido / testUpdateCouchBaseWithoutView.dart
Last active August 29, 2015 14:03
Update Couchbase Without View
void testUpdateCouchBaseWithoutView() {
print("Testing Update CouchBase without View...");
CouchClient _dbclient;
CouchClient.connect([Uri.parse("http://10.1.4.112:8091/pools")], "default", "").then((CouchClient c) {
_dbclient = c;
}).then((_) {