/test/protobuf_test/rethink-db-cpp-driver/README.md

https://gitlab.com/asimpletune/rethinkdb · Markdown · 96 lines · 74 code · 22 blank · 0 comment · 0 complexity · c31ff13c5074331d2c0c152305c62de1 MD5 · raw file

  1. # RethinkDB C++ driver v0.1
  2. > Disclaimer: This project has been created for my C++ class at Charles University in Prague. It is not maintained anymore and may contain anti-patterns. It is not production-ready - use it at your own risk.
  3. This project has been developed on (emulated) Windows 8 using Microsoft Visual Studio 2013 RC.
  4. **Pull requests are welcomed!**
  5. Functionality
  6. -------------
  7. Essential functionality has been implemented only.
  8. shared_ptr <connection> conn(new connection("host", "port", "default db", "auth_key"));
  9. conn->use("default_db"); // change default db
  10. conn->r()->db_create("my_db")->run(); // creating a db
  11. conn->r()->db_drop("my_db")->run(); // dropping a db
  12. conn->r()->db_list()->run(); // listing all dbs
  13. conn->r()->db("my_db")->table("my_table")->run(); // listing all entries in a table
  14. conn->r()->table_create("my_table")->run(); // creating a table in a default db
  15. conn->r()->db->("my_db")->table_drop("my_table")->run(); // dropping a table
  16. conn->r()->db->("my_db")->table_list()->run(); // listing all tables
  17. conn->r()->db(db_name)->table("my_table")->insert(RQL_Object("key", RQL_String("value")))->run(); // inserting an object
  18. conn->r()->db(db_name)->table("my_table")->update(RQL_Object("key", RQL_String("value")))->run(); // updating an object
  19. conn->r()->db(db_name)->table("my_table")->get("my_id")->run(); // getting an object by its primary key
  20. conn->r()->db(db_name)->table("my_table")->between("from", "to")->run(); // getting an object inbetween given primary keys
  21. conn->r()->db(db_name)->table("my_table")->get("my_id")->remove()->run(); // removing an object by its primary key
  22. conn->r()->db(db_name)->table("my_table")->filter(RQL_Object("my_key", RQL_String("value")))->remove()->run(); // removing all filtered objects
  23. // filter all results, order them, set an offset and a limit
  24. conn->r()->db(db_name)->table("my_table")->filter(RQL_Object("my_key", RQL_String("value")))->order_by(RQL_Ordering::asc("my_key"))->skip(3)->limit(10)->run();
  25. See `example.cpp` for more.
  26. Project structure
  27. -------------------------
  28. | File | Description |
  29. | ------------------------------------- | ----------- |
  30. | LICENSE |
  31. | LICENSE.txt |
  32. | README.md |
  33. | connection.cpp | Object for maintaining a single connection to RDB
  34. | connection.hpp |
  35. | example.cpp | Example usage of the driver, fully compilable
  36. | exception.hpp | Definitions of exceptions
  37. | include | Protobuf sources
  38. | lib | Protobuf libraries compiled for Windows 8 (please ignore if not using Windows 8)
  39. | proto | RethinkBD Protobuf
  40. | rethink_db.hpp | Meta file for inclusion in your project
  41. | rethink_db_cpp_driver.opensdf | MS VS 2013 Project file
  42. | rethink_db_cpp_driver.sdf | MS VS 2013 Project file
  43. | rethink_db_cpp_driver.sln | MS VS 2013 Project file
  44. | rethink_db_cpp_driver.v12.suo | MS VS 2013 Project file
  45. | rethink_db_cpp_driver.vcxproj | MS VS 2013 Project file
  46. | rethink_db_cpp_driver.vcxproj.filters | MS VS 2013 Project file
  47. | rethink_db_cpp_driver.vcxproj.user | MS VS 2013 Project file
  48. | rql.cpp | Implementation of RQL data structures in C++
  49. | rql.hpp | Implementation of RQL data structures in C++
  50. Usage instructions
  51. ------------------
  52. 1. checkout the repository
  53. 2. make sure you have boost and protobuf installed - if you are on Windows 8 you can make use of the `lib/` and `include/` directories
  54. 4. `#include "rethinkdb.hpp"` and you are set!
  55. 5. see `example.cpp` for more
  56. License
  57. -------
  58. Released under MIT license.
  59. Permission is hereby granted, free of charge, to any person obtaining
  60. a copy of this software and associated documentation files (the
  61. "Software"), to deal in the Software without restriction, including
  62. without limitation the rights to use, copy, modify, merge, publish,
  63. distribute, sublicense, and/or sell copies of the Software, and to
  64. permit persons to whom the Software is furnished to do so, subject to
  65. the following conditions:
  66. The above copyright notice and this permission notice shall be
  67. included in all copies or substantial portions of the Software.
  68. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  69. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  70. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  71. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  72. LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  73. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  74. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.