Commit Graph

40 Commits

Author SHA1 Message Date
An Tao
ffda84627b
Modify Mapper and CoroMapper templates (#722) 2021-02-20 10:00:28 +08:00
An Tao
3b8b63d17d
Add drogon::orm::CoroMapper<T> template (#712)
Co-authored-by: marty1885 <marty188586@gmail.com>
2021-02-13 18:22:17 +08:00
An Tao
cfb71cc619
Add transactions test of coroutines (#711) 2021-02-10 23:24:15 +08:00
interfector18
6542236b20
Add default value interface to sqlbinder for mysql and postgresql (#704) 2021-02-07 10:34:49 +08:00
Martin Chang
a2142dd93e
Coroutine support (#693)
* app().registerHttpHandler() accepts coroutine as handlers
* HttpController can use coroutine as handlers'
* Http request handlers with coroutine catches exception instead of crashing the entire app
* DbClient now has execSqlCoro that is awaitable
* DbClient now has newTransactionCoro that is awaitable
* HttpClient have awaitable sendRequestCoro
* WebSocketClient have awaitable connectToServerCoro
* WebSocketClient have setAsyncMessageHandler and setAsyncConnectionClosedHandler
* drogon::AsyncTask and drogon::Task<T> as our corutine types
* Related tests
* Misc

Future work
* Coroutine for WebSocket server
* Known issues

co_future() and sync_wait may crash. It looks like GCC bug but I'm not sure.
Workarround: Make an coroutine of AsyncTask. Then launch said coroutine.
Not sure why wrapping the exact same thing in function crashes things.

Co-authored-by: an-tao <antao2002@gmail.com>
2021-02-06 17:05:58 +08:00
An Tao
566297d4df
Create cmake.yml (#653) 2020-12-13 18:12:30 +08:00
An Tao
594911b7a2
Fix a bug in the Mapper::insertFuture() (#620) 2020-10-29 20:09:16 +08:00
An Tao
9c54fb8c69
Modify generation of models and the DbClient class (#498)
* Add setter method for automatical fields of models

* Put SQL queries into buffer before any connection being established

* Update trantor
2020-07-03 12:19:40 +08:00
An Tao
3424d3f2c4
Add a way to set the character set when creating DbClient objects (#486) 2020-06-20 20:21:14 +08:00
An Tao
b3d1f151b5
Fix the count() method of Mysql ORM (#468) 2020-06-09 00:54:12 +08:00
An Tao
4423d836f4
Add methods to get DbClient connection status (#436) 2020-05-18 08:31:18 +08:00
An Tao
4f8290b589
Remove non standard macros (#415) 2020-04-25 02:12:44 +08:00
interfector18
17b8c337f9
Standardize Row and Result api (#409)
* Standardize Row and Result api, throw specific exceptions

* Fix drogon_ctl for sqlite3 models

* Add mysql and sqlite3 tests, add exception throwing tests

* configure mysql in travis-ci

Co-authored-by: antao <antao2002@gmail.com>
2020-04-11 11:46:47 +08:00
An Tao
58702dc41e
Port drogon to Windows (#335)
Co-authored-by: mcirsta <mforce2@gmail.com>
2020-01-25 11:58:20 +08:00
An Tao
fd6df92bbc
Fix an error in the batch mode of libpq. (#317) 2019-12-11 14:23:52 +08:00
An Tao
40ffb2d2af
Modify some code styles (#298) 2019-11-21 11:27:47 +08:00
An Tao
e8a6bdc245
Fix some race conditions (#270) 2019-10-04 14:17:48 +08:00
An Tao
70eda27427
Add the ability to create restful API controllers (#244)
* Add the ability to create restful API controllers

* Update the model.json template file

* Modify the 'create controller' command of the drogon_ctl

* access column values by column array indexes instead of column names when constructing an instance of a model class

* Fix a bug of mysql database

* Add some static SQL into models

* Add validations to models

* Add setToNull method to models

* Support 'where in' substatement

* Delay rendering from json to the response body. This allows users to modify the json object before sending a response.

* Add synchronous method to the HttpClient class
2019-09-30 21:34:30 +08:00
An Tao
93573c99bf
Fix the fail in travis ci (#260) 2019-09-28 20:35:05 +08:00
An Tao
0b45135391
Modify database tests (#258) 2019-09-27 17:34:02 +08:00
Daniel Mensinger
795079531a cmake: use export namespace for Drogon::Drogon (#255)
* cmake: use ${PROJECT_NAME} instead of drogon everywere

* cmake: use export namespace instead of dummy library
2019-09-26 19:33:58 +08:00
An Tao
456d003482
Add prefixes to column name variables in model classes (#242) 2019-09-13 08:28:58 +08:00
An Tao
aa26e9a903
Modify the CMakeLists to modern cmake style (#229) 2019-08-31 08:27:57 +08:00
An Tao
4e274b1a2e
Modify the orm command of drogon_ctl (#224) 2019-08-24 18:43:05 +08:00
An Tao
b5a142a10e
Fix bugs in default return values of functions (#220) 2019-08-22 22:23:50 +08:00
An Tao
f940b6f2cd
Modify some stuff (#216) 2019-08-17 20:05:32 +08:00
An Tao
bf88d08f78
Modify the test of postgresql database (#215) 2019-08-17 12:40:39 +08:00
An Tao
10db494556
Add database tests in the travis CI (#214) 2019-08-16 23:41:03 +08:00
antao
40087fba9c Remove config.h
Modify the CMakeLists.txt

Remove the USE_ORM macro

Update trantor

Remove some std::dynamic_pointer_cast calls
2019-07-29 14:53:41 +08:00
antao
3452a2fa1c Modify some code to get a good style 2019-05-23 18:57:45 +08:00
antao
11b6d20a69 clang-format 2019-05-18 20:39:57 +08:00
antao
e5fe92c67a Change the line length limit to 80 characters 2019-05-18 11:11:45 +08:00
antao
be08aba9d1 Add .clang-format 2019-05-17 22:49:09 +08:00
antao
e48692939c Modify some interfaces 2019-04-29 14:47:23 +08:00
zhangjunjun
a580f89c8b Add query test in db_test.cc for orm_lib 2019-03-20 21:56:56 +08:00
antao
801cb8aa35 Modify some database classes 2019-03-07 11:56:20 +08:00
an-tao
56c2cfb609 Update tests 2018-12-03 18:12:19 +08:00
an-tao
ffbdac36c9 Modify cmake files for the mariadb database on linux 2018-12-03 17:03:45 +08:00
antao
458d14591b Modify some strings 2018-12-03 10:13:31 +08:00
antao
20f97a78a2 Modify tests path 2018-11-27 18:29:23 +08:00