summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authoradam <adamansky@gmail.com>2013-02-14 18:00:08 +0700
committeradam <adamansky@gmail.com>2013-02-14 18:00:08 +0700
commit9e392f4906f2e84aea077eea4d35c6f88fff1bd8 (patch)
treea7f5070e5b6afbc918fcba08a6397b6cff56b636 /node
parent08d9f1119110997ea6bd11238ba2b595ffb71df5 (diff)
downloadejdb-9e392f4906f2e84aea077eea4d35c6f88fff1bd8.tar.gz
ejdb-9e392f4906f2e84aea077eea4d35c6f88fff1bd8.tar.bz2
ejdb-9e392f4906f2e84aea077eea4d35c6f88fff1bd8.zip
#47
Diffstat (limited to 'node')
-rw-r--r--node/ejdb.js18
-rw-r--r--node/ejdb_args.h20
-rw-r--r--node/ejdb_cmd.h19
-rw-r--r--node/ejdb_logging.cc16
-rw-r--r--node/ejdb_logging.h19
-rw-r--r--node/ejdb_native.cc19
-rw-r--r--node/ejdb_thread.h16
7 files changed, 108 insertions, 19 deletions
diff --git a/node/ejdb.js b/node/ejdb.js
index a552086..1366080 100644
--- a/node/ejdb.js
+++ b/node/ejdb.js
@@ -1,3 +1,19 @@
+/**************************************************************************************************
+ * NodeJS API for EJDB database library http://ejdb.org
+ * Copyright (C) 2012-2013 Softmotions Ltd <info@softmotions.com>
+ *
+ * This file is part of EJDB.
+ * EJDB is free software; you can redistribute it and/or modify it under the terms of
+ * the GNU Lesser General Public License as published by the Free Software Foundation; either
+ * version 2.1 of the License or any later version. EJDB is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ * You should have received a copy of the GNU Lesser General Public License along with EJDB;
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA.
+ *************************************************************************************************/
+
var ejdblib;
try {
ejdblib = require("../build/Release/ejdb_native.node");
@@ -357,8 +373,6 @@ function parseQueryArgs(args) {
* }
* }
*
- * Many C API query examples can be found in `tcejdb/testejdb/t2.c` test case.
- *
* To traverse selected records cursor object is used:
* - Cursor#next() Move cursor to the next record and returns true if next record exists.
* - Cursor#hasNext() Returns true if cursor can be placed to the next record.
diff --git a/node/ejdb_args.h b/node/ejdb_args.h
index ff64add..ed663a8 100644
--- a/node/ejdb_args.h
+++ b/node/ejdb_args.h
@@ -1,9 +1,19 @@
-/*
- * File: node_args.h
- * Author: adam
+/**************************************************************************************************
+ * EJDB database library http://ejdb.org
+ * Copyright (C) 2012-2013 Softmotions Ltd <info@softmotions.com>
*
- * Created on October 30, 2012, 10:37 AM
- */
+ * This file is part of EJDB.
+ * EJDB is free software; you can redistribute it and/or modify it under the terms of
+ * the GNU Lesser General Public License as published by the Free Software Foundation; either
+ * version 2.1 of the License or any later version. EJDB is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ * You should have received a copy of the GNU Lesser General Public License along with EJDB;
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA.
+ *************************************************************************************************/
+
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
diff --git a/node/ejdb_cmd.h b/node/ejdb_cmd.h
index f03ee8a..effee9c 100644
--- a/node/ejdb_cmd.h
+++ b/node/ejdb_cmd.h
@@ -1,9 +1,18 @@
-/*
- * File: ejdb_cmd.h
- * Author: adam
+/**************************************************************************************************
+ * EJDB database library http://ejdb.org
+ * Copyright (C) 2012-2013 Softmotions Ltd <info@softmotions.com>
*
- * Created on October 30, 2012, 11:41 AM
- */
+ * This file is part of EJDB.
+ * EJDB is free software; you can redistribute it and/or modify it under the terms of
+ * the GNU Lesser General Public License as published by the Free Software Foundation; either
+ * version 2.1 of the License or any later version. EJDB is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ * You should have received a copy of the GNU Lesser General Public License along with EJDB;
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA.
+ *************************************************************************************************/
#ifndef EJDB_CMD_H
#define EJDB_CMD_H
diff --git a/node/ejdb_logging.cc b/node/ejdb_logging.cc
index 9b92df1..fd895fc 100644
--- a/node/ejdb_logging.cc
+++ b/node/ejdb_logging.cc
@@ -1,3 +1,19 @@
+/**************************************************************************************************
+ * EJDB database library http://ejdb.org
+ * Copyright (C) 2012-2013 Softmotions Ltd <info@softmotions.com>
+ *
+ * This file is part of EJDB.
+ * EJDB is free software; you can redistribute it and/or modify it under the terms of
+ * the GNU Lesser General Public License as published by the Free Software Foundation; either
+ * version 2.1 of the License or any later version. EJDB is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ * You should have received a copy of the GNU Lesser General Public License along with EJDB;
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA.
+ *************************************************************************************************/
+
#include "ejdb_logging.h"
#include "ejdb_thread.h"
diff --git a/node/ejdb_logging.h b/node/ejdb_logging.h
index 296948c..9f0e337 100644
--- a/node/ejdb_logging.h
+++ b/node/ejdb_logging.h
@@ -1,9 +1,18 @@
-/*
- * File: ejdb_logging.h
- * Author: adam
+/**************************************************************************************************
+ * EJDB database library http://ejdb.org
+ * Copyright (C) 2012-2013 Softmotions Ltd <info@softmotions.com>
*
- * Created on October 30, 2012, 12:15 PM
- */
+ * This file is part of EJDB.
+ * EJDB is free software; you can redistribute it and/or modify it under the terms of
+ * the GNU Lesser General Public License as published by the Free Software Foundation; either
+ * version 2.1 of the License or any later version. EJDB is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ * You should have received a copy of the GNU Lesser General Public License along with EJDB;
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA.
+ *************************************************************************************************/
#if _MSC_VER > 1000
#pragma once
diff --git a/node/ejdb_native.cc b/node/ejdb_native.cc
index c03b613..a9b2ebd 100644
--- a/node/ejdb_native.cc
+++ b/node/ejdb_native.cc
@@ -1,3 +1,18 @@
+/**************************************************************************************************
+ * EJDB database library http://ejdb.org
+ * Copyright (C) 2012-2013 Softmotions Ltd <info@softmotions.com>
+ *
+ * This file is part of EJDB.
+ * EJDB is free software; you can redistribute it and/or modify it under the terms of
+ * the GNU Lesser General Public License as published by the Free Software Foundation; either
+ * version 2.1 of the License or any later version. EJDB is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ * You should have received a copy of the GNU Lesser General Public License along with EJDB;
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA.
+ *************************************************************************************************/
#include <v8.h>
#include <node.h>
@@ -700,7 +715,7 @@ namespace ejdb {
bson_init(bs);
toBSON(Handle<Object>::Cast(v), bs, false);
if (bs->err) {
- Local<String> msg = String::New(bs->errstr ? bs->errstr : "BSON creation failed");
+ Local<String> msg = String::New(bson_first_errormsg(bs));
bson_del(bs);
delete cmdata;
return scope.Close(ThrowException(Exception::Error(msg)));
@@ -755,7 +770,7 @@ namespace ejdb {
toBSON(Local<Object>::Cast(qv), bs, true);
bson_finish(bs);
if (bs->err) {
- Local<String> msg = String::New(bs->errstr ? bs->errstr : "BSON error");
+ Local<String> msg = String::New(bson_first_errormsg(bs));
bson_del(bs);
delete cmdata;
return scope.Close(ThrowException(Exception::Error(msg)));
diff --git a/node/ejdb_thread.h b/node/ejdb_thread.h
index f6557e6..576cc9e 100644
--- a/node/ejdb_thread.h
+++ b/node/ejdb_thread.h
@@ -1,3 +1,19 @@
+/**************************************************************************************************
+ * EJDB database library http://ejdb.org
+ * Copyright (C) 2012-2013 Softmotions Ltd <info@softmotions.com>
+ *
+ * This file is part of EJDB.
+ * EJDB is free software; you can redistribute it and/or modify it under the terms of
+ * the GNU Lesser General Public License as published by the Free Software Foundation; either
+ * version 2.1 of the License or any later version. EJDB is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ * You should have received a copy of the GNU Lesser General Public License along with EJDB;
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA.
+ *************************************************************************************************/
+
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000