Browse Source

Merge branch 'master' into tio-server

litongjava 5 months ago
parent
commit
bdd5bde0c3
100 changed files with 22170 additions and 1494 deletions
  1. 46 44
      frameworks/C++/paozhu/paozhu.dockerfile
  2. 91 84
      frameworks/C++/paozhu/paozhu_benchmark/CMakeLists.txt
  3. 21 6
      frameworks/C++/paozhu/paozhu_benchmark/common/autocontrolmethod.hpp
  4. 3 0
      frameworks/C++/paozhu/paozhu_benchmark/common/cost_define.h
  5. 13 2
      frameworks/C++/paozhu/paozhu_benchmark/common/httphook.cpp
  6. 4 2
      frameworks/C++/paozhu/paozhu_benchmark/conf/orm.conf
  7. 11 11
      frameworks/C++/paozhu/paozhu_benchmark/conf/server.conf
  8. 9 11
      frameworks/C++/paozhu/paozhu_benchmark/controller/include/techempower.h
  9. 199 190
      frameworks/C++/paozhu/paozhu_benchmark/controller/src/techempower.cpp
  10. 7 7
      frameworks/C++/paozhu/paozhu_benchmark/models/Fortune.cpp
  11. 7 7
      frameworks/C++/paozhu/paozhu_benchmark/models/World.cpp
  12. 3 3
      frameworks/C++/paozhu/paozhu_benchmark/models/include/Fortune.h
  13. 3 3
      frameworks/C++/paozhu/paozhu_benchmark/models/include/World.h
  14. 9788 0
      frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortune_mysql.h
  15. 269 330
      frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortunebase.h
  16. 9628 0
      frameworks/C++/paozhu/paozhu_benchmark/orm/include/world_mysql.h
  17. 266 327
      frameworks/C++/paozhu/paozhu_benchmark/orm/include/worldbase.h
  18. 1 1
      frameworks/CSharp/fastendpoints/Benchmarks/Benchmarks.csproj
  19. 3 2
      frameworks/CSharp/fastendpoints/Benchmarks/Endpoints/JsonEndpoint.cs
  20. 6 5
      frameworks/CSharp/fastendpoints/Benchmarks/Endpoints/PlainTextEndpoint.cs
  21. 5 5
      frameworks/CSharp/fastendpoints/Benchmarks/Program.cs
  22. 3 3
      frameworks/CSharp/fastendpoints/README.md
  23. 6 2
      frameworks/CSharp/fastendpoints/fastendpoints.dockerfile
  24. 7 8
      frameworks/CSharp/genhttp/Benchmarks/Benchmarks.csproj
  25. 4 2
      frameworks/CSharp/genhttp/Benchmarks/Program.cs
  26. 39 0
      frameworks/CSharp/genhttp/Benchmarks/Tests/JsonHandler.cs
  27. 0 20
      frameworks/CSharp/genhttp/Benchmarks/Tests/JsonResource.cs
  28. 5 0
      frameworks/CSharp/genhttp/genhttp.dockerfile
  29. 2 4
      frameworks/CSharp/sisk/benchmark_config.json
  30. 1 1
      frameworks/CSharp/sisk/config.toml
  31. 7 3
      frameworks/CSharp/sisk/sisk-cadente.dockerfile
  32. 22 14
      frameworks/CSharp/sisk/sisk-cadente/Program.cs
  33. 11 11
      frameworks/CSharp/sisk/sisk-cadente/sisk.csproj
  34. 6 2
      frameworks/CSharp/sisk/sisk/Program.cs
  35. 5 5
      frameworks/FSharp/falco/README.md
  36. 1 1
      frameworks/FSharp/falco/benchmark_config.json
  37. 4 4
      frameworks/FSharp/falco/falco.dockerfile
  38. 3 8
      frameworks/FSharp/falco/src/App/App.fsproj
  39. 0 83
      frameworks/FSharp/falco/src/App/Fortune.fs
  40. 86 11
      frameworks/FSharp/falco/src/App/Program.fs
  41. 0 47
      frameworks/FSharp/falco/src/App/Server.fs
  42. 0 11
      frameworks/FSharp/falco/src/App/UI.fs
  43. 78 0
      frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientConnection.java
  44. 11 116
      frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientConnectionPool.java
  45. 60 0
      frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientConnectionPoolArray.java
  46. 2 5
      frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientRepository.java
  47. 2 0
      frameworks/Java/helidon/nima/src/main/resources/application.yaml
  48. 1 1
      frameworks/Java/inverno/inverno-postgres.dockerfile
  49. 1 1
      frameworks/Java/inverno/inverno.dockerfile
  50. 3 3
      frameworks/Java/smart-socket/benchmark_config.json
  51. 2 2
      frameworks/Java/smart-socket/feat-smart-servlet.dockerfile
  52. 2 2
      frameworks/Java/smart-socket/feat.dockerfile
  53. 24 9
      frameworks/Java/smart-socket/pom.xml
  54. 18 17
      frameworks/Java/smart-socket/src/main/java/org/smartboot/http/Bootstrap.java
  55. 24 0
      frameworks/Java/smart-socket/src/main/java/org/smartboot/http/FeatController.java
  56. 19 0
      frameworks/Java/tio-boot/.dockerignore
  57. 3 0
      frameworks/Java/tio-boot/.gitignore
  58. 114 0
      frameworks/Java/tio-boot/README.md
  59. 227 0
      frameworks/Java/tio-boot/api/tio-server-benchmark.md
  60. 29 0
      frameworks/Java/tio-boot/benchmark_config.json
  61. 19 0
      frameworks/Java/tio-boot/config.toml
  62. 126 0
      frameworks/Java/tio-boot/pom.xml
  63. 13 0
      frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/MainApp.java
  64. 54 0
      frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/MainAppConfig.java
  65. 12 0
      frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/config/EhCachePluginConfig.java
  66. 22 0
      frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/config/EnjoyEngineConfig.java
  67. 31 0
      frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/config/MysqlDbConfig.java
  68. 41 0
      frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/controller/CacheHandler.java
  69. 126 0
      frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/controller/DbHandler.java
  70. 40 0
      frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/controller/IndexHandler.java
  71. 23 0
      frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/model/Fortune.java
  72. 12 0
      frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/model/Message.java
  73. 32 0
      frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/model/World.java
  74. 50 0
      frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/services/CacheName.java
  75. 17 0
      frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/services/CacheNameService.java
  76. 36 0
      frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/utils/RandomUtils.java
  77. 9 0
      frameworks/Java/tio-boot/src/main/resources/app.properties
  78. 9 0
      frameworks/Java/tio-boot/src/main/resources/ehcache.xml
  79. 52 0
      frameworks/Java/tio-boot/src/main/resources/logback.xml
  80. 20 0
      frameworks/Java/tio-boot/src/main/resources/templates/fortunes.html
  81. 15 0
      frameworks/Java/tio-boot/src/test/java/com/litongjava/tio/http/server/MainAppTest.java
  82. 20 0
      frameworks/Java/tio-boot/tio-boot.dockerfile
  83. 27 0
      frameworks/JavaScript/aroma.js/README.md
  84. 36 0
      frameworks/JavaScript/aroma.js/app.js
  85. 11 0
      frameworks/JavaScript/aroma.js/aroma.js.dockerfile
  86. 21 0
      frameworks/JavaScript/aroma.js/benchmark_config.json
  87. 13 0
      frameworks/JavaScript/aroma.js/config.toml
  88. 8 0
      frameworks/JavaScript/aroma.js/package.json
  89. 1 1
      frameworks/JavaScript/koa/package.json
  90. 4 4
      frameworks/Kotlin/hexagon/benchmark_config.json
  91. 10 10
      frameworks/Kotlin/hexagon/build.gradle
  92. 2 2
      frameworks/Kotlin/hexagon/config.toml
  93. 5 5
      frameworks/Kotlin/hexagon/core/build.gradle
  94. 6 6
      frameworks/Kotlin/hexagon/core/src/main/kotlin/Benchmark.kt
  95. 20 20
      frameworks/Kotlin/hexagon/core/src/main/kotlin/Controller.kt
  96. 5 5
      frameworks/Kotlin/hexagon/core/src/main/kotlin/store/BenchmarkStore.kt
  97. 4 1
      frameworks/Kotlin/hexagon/core/src/main/resources/META-INF/native-image/com.hexagonkt.benchmark/core/native-image.properties
  98. 1 1
      frameworks/Kotlin/hexagon/core/src/main/resources/fortunes.jte
  99. 1 1
      frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.properties
  100. 1 2
      frameworks/Kotlin/hexagon/gradlew

+ 46 - 44
frameworks/C++/paozhu/paozhu.dockerfile

@@ -4,8 +4,8 @@ RUN apt-get install -yqq gcc g++ openssl libssl-dev zlib1g-dev build-essential l
 
 
 RUN apt-get -y install brotli libbrotli-dev 
 RUN apt-get -y install brotli libbrotli-dev 
 RUN apt-get -y install libreadline-dev 
 RUN apt-get -y install libreadline-dev 
-RUN apt-get -y install mysql-client
-RUN apt-get -y install libmysqlclient-dev
+# RUN apt-get -y install mysql-client
+# RUN apt-get -y install libmysqlclient-dev
 
 
 RUN locale-gen en_US.UTF-8
 RUN locale-gen en_US.UTF-8
 ENV LANG en_US.UTF-8
 ENV LANG en_US.UTF-8
@@ -18,13 +18,13 @@ WORKDIR /
 # RUN wget https://github.com/hggq/paozhu/releases/download/v1.5.8/benchmark.zip
 # RUN wget https://github.com/hggq/paozhu/releases/download/v1.5.8/benchmark.zip
 RUN git clone https://github.com/hggq/paozhu
 RUN git clone https://github.com/hggq/paozhu
 # RUN unzip benchmark.zip
 # RUN unzip benchmark.zip
-# RUN rm -Rf ./paozhu/controller
-# RUN rm -Rf ./paozhu/libs
+RUN rm -Rf ./paozhu/controller
+RUN rm -Rf ./paozhu/libs
 # RUN rm -Rf ./paozhu/view
 # RUN rm -Rf ./paozhu/view
-# RUN rm -Rf ./paozhu/viewsrc
-# RUN rm -Rf ./paozhu/orm
-# RUN rm -Rf ./paozhu/models
-# RUN rm -Rf ./paozhu/common
+RUN rm -Rf ./paozhu/viewsrc
+RUN rm -Rf ./paozhu/orm
+RUN rm -Rf ./paozhu/models
+RUN rm -Rf ./paozhu/common
 
 
 
 
 
 
@@ -39,29 +39,29 @@ RUN git clone https://github.com/hggq/paozhu
 
 
 # RUN ls -l ./paozhu
 # RUN ls -l ./paozhu
 # RUN pwd
 # RUN pwd
-# RUN mkdir ./paozhu/common
-# RUN mkdir ./paozhu/libs
-# RUN mkdir ./paozhu/libs/types
-# COPY ./paozhu_benchmark/libs/types/techempower_json.h ./paozhu/libs/types/
-# COPY ./paozhu_benchmark/libs/types/techempower_json_jsonreflect.cpp ./paozhu/libs/types/
+RUN mkdir ./paozhu/common
+RUN mkdir ./paozhu/libs
+RUN mkdir ./paozhu/libs/types
+COPY ./paozhu_benchmark/libs/types/techempower_json.h ./paozhu/libs/types/
+COPY ./paozhu_benchmark/libs/types/techempower_json_jsonreflect.cpp ./paozhu/libs/types/
 
 
-# RUN mkdir ./paozhu/controller
-# RUN mkdir ./paozhu/controller/include
-# RUN mkdir ./paozhu/controller/src
+RUN mkdir ./paozhu/controller
+RUN mkdir ./paozhu/controller/include
+RUN mkdir ./paozhu/controller/src
 
 
-# COPY ./paozhu_benchmark/controller/include/techempower.h ./paozhu/controller/include/
-# COPY ./paozhu_benchmark/controller/src/techempower.cpp ./paozhu/controller/src/
+COPY ./paozhu_benchmark/controller/include/techempower.h ./paozhu/controller/include/
+COPY ./paozhu_benchmark/controller/src/techempower.cpp ./paozhu/controller/src/
 
 
 
 
-# COPY ./paozhu_benchmark/common/autocontrolmethod.hpp ./paozhu/common/
-# COPY ./paozhu_benchmark/common/reghttpmethod_pre.hpp ./paozhu/common/
-# COPY ./paozhu_benchmark/common/reghttpmethod.hpp ./paozhu/common/
-# COPY ./paozhu_benchmark/common/json_reflect_headers.h ./paozhu/common/
+COPY ./paozhu_benchmark/common/autocontrolmethod.hpp ./paozhu/common/
+COPY ./paozhu_benchmark/common/reghttpmethod_pre.hpp ./paozhu/common/
+COPY ./paozhu_benchmark/common/reghttpmethod.hpp ./paozhu/common/
+COPY ./paozhu_benchmark/common/json_reflect_headers.h ./paozhu/common/
 
 
-# COPY ./paozhu_benchmark/common/cost_define.h ./paozhu/common/
-# COPY ./paozhu_benchmark/common/autorestfulpaths.hpp ./paozhu/common/
-# COPY ./paozhu_benchmark/common/websockets_method_reg.hpp ./paozhu/common/
-# COPY ./paozhu_benchmark/common/httphook.cpp ./paozhu/common/
+COPY ./paozhu_benchmark/common/cost_define.h ./paozhu/common/
+COPY ./paozhu_benchmark/common/autorestfulpaths.hpp ./paozhu/common/
+COPY ./paozhu_benchmark/common/websockets_method_reg.hpp ./paozhu/common/
+COPY ./paozhu_benchmark/common/httphook.cpp ./paozhu/common/
 
 
 COPY ./paozhu_benchmark/conf/server.conf ./paozhu/conf/server.conf
 COPY ./paozhu_benchmark/conf/server.conf ./paozhu/conf/server.conf
 COPY ./paozhu_benchmark/conf/orm.conf ./paozhu/conf/orm.conf
 COPY ./paozhu_benchmark/conf/orm.conf ./paozhu/conf/orm.conf
@@ -74,32 +74,34 @@ COPY ./paozhu_benchmark/CMakeLists.txt ./paozhu/CMakeLists.txt
 
 
 # COPY ./paozhu_benchmark/view/techempower/fortunes.html ./paozhu/view/techempower/
 # COPY ./paozhu_benchmark/view/techempower/fortunes.html ./paozhu/view/techempower/
 
 
-# RUN mkdir ./paozhu/viewsrc
-# RUN mkdir ./paozhu/viewsrc/include
-# RUN mkdir ./paozhu/viewsrc/view
-# RUN mkdir ./paozhu/viewsrc/view/techempower
+RUN mkdir ./paozhu/viewsrc
+RUN mkdir ./paozhu/viewsrc/include
+RUN mkdir ./paozhu/viewsrc/view
+RUN mkdir ./paozhu/viewsrc/view/techempower
 
 
-# COPY ./paozhu_benchmark/viewsrc/view/techempower/fortunes.cpp ./paozhu/viewsrc/view/techempower/
-# COPY ./paozhu_benchmark/viewsrc/include/viewsrc.h ./paozhu/viewsrc/include/
-# COPY ./paozhu_benchmark/viewsrc/include/regviewmethod.hpp ./paozhu/viewsrc/include/
+COPY ./paozhu_benchmark/viewsrc/view/techempower/fortunes.cpp ./paozhu/viewsrc/view/techempower/
+COPY ./paozhu_benchmark/viewsrc/include/viewsrc.h ./paozhu/viewsrc/include/
+COPY ./paozhu_benchmark/viewsrc/include/regviewmethod.hpp ./paozhu/viewsrc/include/
 
 
 
 
 
 
-# RUN mkdir ./paozhu/orm
-# RUN mkdir ./paozhu/orm/include
+RUN mkdir ./paozhu/orm
+RUN mkdir ./paozhu/orm/include
 
 
 
 
-# COPY ./paozhu_benchmark/orm/orm.h ./paozhu/orm/
-# COPY ./paozhu_benchmark/orm/include/fortunebase.h ./paozhu/orm/include/
-# COPY ./paozhu_benchmark/orm/include/worldbase.h ./paozhu/orm/include/
+COPY ./paozhu_benchmark/orm/orm.h ./paozhu/orm/
+COPY ./paozhu_benchmark/orm/include/fortunebase.h ./paozhu/orm/include/
+COPY ./paozhu_benchmark/orm/include/worldbase.h ./paozhu/orm/include/
+COPY ./paozhu_benchmark/orm/include/fortune_mysql.h ./paozhu/orm/include/
+COPY ./paozhu_benchmark/orm/include/world_mysql.h ./paozhu/orm/include/
 
 
-# RUN mkdir ./paozhu/models
-# RUN mkdir ./paozhu/models/include
+RUN mkdir ./paozhu/models
+RUN mkdir ./paozhu/models/include
 
 
-# COPY ./paozhu_benchmark/models/include/Fortune.h ./paozhu/models/include/
-# COPY ./paozhu_benchmark/models/include/World.h ./paozhu/models/include/
-# COPY ./paozhu_benchmark/models/World.cpp ./paozhu/models/
-# COPY ./paozhu_benchmark/models/Fortune.cpp ./paozhu/models/
+COPY ./paozhu_benchmark/models/include/Fortune.h ./paozhu/models/include/
+COPY ./paozhu_benchmark/models/include/World.h ./paozhu/models/include/
+COPY ./paozhu_benchmark/models/World.cpp ./paozhu/models/
+COPY ./paozhu_benchmark/models/Fortune.cpp ./paozhu/models/
 
 
 WORKDIR /paozhu
 WORKDIR /paozhu
 RUN unzip asio.zip
 RUN unzip asio.zip

+ 91 - 84
frameworks/C++/paozhu/paozhu_benchmark/CMakeLists.txt

@@ -73,7 +73,7 @@ if(${mode} AND (CMAKE_BUILD_TYPE STREQUAL "Debug"))
         endif ()
         endif ()
     else()
     else()
         set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra")
         set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra")
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pthread -g -fsanitize=address -DASIO_STANDALONE -DBENCHMARK -DDEBUG ${BOOST_OPEN} ${GD_OPEN} -I/usr/local/include -I/usr/local/mysql/include   -I/usr/include -I/usr/include/mysql " )
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pthread -g -fsanitize=address -DASIO_STANDALONE -DBENCHMARK -DDEBUG ${BOOST_OPEN} ${GD_OPEN} -I/usr/local/include -I/usr/include " )
     endif ()
     endif ()
     message("Debug mode:${CMAKE_CXX_FLAGS_DEBUG}")
     message("Debug mode:${CMAKE_CXX_FLAGS_DEBUG}")
 
 
@@ -86,7 +86,7 @@ elseif(${mode} AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
         endif ()
         endif ()
     else ()
     else ()
         set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wextra -O3")
         set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wextra -O3")
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread  -DASIO_STANDALONE ${BOOST_OPEN} ${GD_OPEN} -DBENCHMARK -I/usr/local/include -I/usr/local/mysql/include -I/usr/include -I/usr/include/mysql  " )
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread  -DASIO_STANDALONE ${BOOST_OPEN} ${GD_OPEN} -DBENCHMARK -I/usr/local/include -I/usr/include  " )
         file(MAKE_DIRECTORY /usr/local/etc/paozhu)
         file(MAKE_DIRECTORY /usr/local/etc/paozhu)
         file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/conf/ DESTINATION /usr/local/etc/paozhu/)
         file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/conf/ DESTINATION /usr/local/etc/paozhu/)
     endif ()
     endif ()
@@ -95,7 +95,7 @@ elseif(${mode} AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
 else()
 else()
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra")
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra")
     message("Debug mode:${CMAKE_CXX_FLAGS_DEBUG}")
     message("Debug mode:${CMAKE_CXX_FLAGS_DEBUG}")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pthread  -g -fsanitize=address  -DASIO_STANDALONE -DBENCHMARK -DDEBUG ${BOOST_OPEN} ${GD_OPEN} -I/usr/local/include -I/usr/local/mysql/include   -I/usr/include  -I/usr/include/mysql  " )
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pthread  -g -fsanitize=address  -DASIO_STANDALONE -DBENCHMARK -DDEBUG ${BOOST_OPEN} ${GD_OPEN} -I/usr/local/include -I/usr/include " )
 
 
     if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
     if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
@@ -122,6 +122,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpcli)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/viewsrc/include)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/viewsrc/include)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/websockets/include)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/websockets/include)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/orm)
 
 
 if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/bin/paozhu_pre)
 if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/bin/paozhu_pre)
   file(REMOVE_RECURSE ${CMAKE_CURRENT_SOURCE_DIR}/bin/paozhu_pre)
   file(REMOVE_RECURSE ${CMAKE_CURRENT_SOURCE_DIR}/bin/paozhu_pre)
@@ -191,7 +192,7 @@ include_sub_directories_recursively(${CMAKE_CURRENT_SOURCE_DIR}/libs)
 include_sub_directories_recursively(${CMAKE_CURRENT_SOURCE_DIR}/include)
 include_sub_directories_recursively(${CMAKE_CURRENT_SOURCE_DIR}/include)
 include_sub_directories_recursively(${CMAKE_CURRENT_SOURCE_DIR}/common)
 include_sub_directories_recursively(${CMAKE_CURRENT_SOURCE_DIR}/common)
 
 
-add_executable(paozhu_cli ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpcli/http_cli.cpp)
+add_executable(paozhu_cli ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpcli/http_cli.cpp ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpserver/src/mysql_conn.cpp ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpserver/src/mysql_conn_pool.cpp ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpserver/src/clientdatacache.cpp)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
 
 
 
 
@@ -230,14 +231,17 @@ if (ENABLE_VCPKG)
     target_link_libraries(paozhu ZLIB::ZLIB)
     target_link_libraries(paozhu ZLIB::ZLIB)
 
 
     # find_package(libmysql REQUIRED)
     # find_package(libmysql REQUIRED)
-    find_package(unofficial-libmariadb CONFIG REQUIRED)
-    find_path(MYSQL_ROOT_DIR mysql)
+    # find_package(unofficial-libmariadb CONFIG REQUIRED)
+    # find_path(MYSQL_ROOT_DIR mysql)
     # target_link_libraries(paozhu ${MYSQL_LIBRARIES})
     # target_link_libraries(paozhu ${MYSQL_LIBRARIES})
     # target_link_libraries(paozhu_cli ${MYSQL_LIBRARIES})
     # target_link_libraries(paozhu_cli ${MYSQL_LIBRARIES})
-    target_link_libraries(paozhu unofficial::libmariadb)
-    target_link_libraries(paozhu_cli unofficial::libmariadb)
-    target_include_directories(paozhu PUBLIC ${MYSQL_ROOT_DIR}/mysql)
-    target_include_directories(paozhu_cli PUBLIC ${MYSQL_ROOT_DIR}/mysql)
+    # target_link_libraries(paozhu unofficial::libmariadb)
+    # target_link_libraries(paozhu_cli unofficial::libmariadb)
+    # target_include_directories(paozhu PUBLIC ${MYSQL_ROOT_DIR}/mysql)
+    # target_include_directories(paozhu_cli PUBLIC ${MYSQL_ROOT_DIR}/mysql)
+
+    target_link_libraries(paozhu_cli asio::asio)
+    target_link_libraries(paozhu_cli OpenSSL::Crypto OpenSSL::SSL)
 
 
     if (ENABLE_GD STREQUAL "ON")
     if (ENABLE_GD STREQUAL "ON")
         find_package(PkgConfig)
         find_package(PkgConfig)
@@ -331,6 +335,9 @@ if(OPENSSL_FOUND)
   INCLUDE_DIRECTORIES("${OPENSSL_INCLUDE_DIR}")
   INCLUDE_DIRECTORIES("${OPENSSL_INCLUDE_DIR}")
   target_link_libraries (paozhu ${OPENSSL_SSL_LIBRARY})
   target_link_libraries (paozhu ${OPENSSL_SSL_LIBRARY})
   target_link_libraries (paozhu ${OPENSSL_CRYPTO_LIBRARY})
   target_link_libraries (paozhu ${OPENSSL_CRYPTO_LIBRARY})
+  
+  target_link_libraries (paozhu_cli ${OPENSSL_SSL_LIBRARY})
+  target_link_libraries (paozhu_cli ${OPENSSL_CRYPTO_LIBRARY})
 endif()
 endif()
 
 
 
 
@@ -343,80 +350,80 @@ if(ZLIB_FOUND)
 endif()
 endif()
 
 
 
 
-if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  if (IS_DIRECTORY "/usr/local/mysql/include")
-  MESSAGE( STATUS "/usr/local/mysql")
-      set(MYSQL_INCLUDE_DIR "/usr/local/mysql/include")
-      include_sub_directories_recursively(/usr/local/mysql/include)
-  endif()
- 
-  if (IS_DIRECTORY "/usr/local/opt/mysql-client")
-        MESSAGE( STATUS "/usr/local/opt/mysql-client")
-      set(MYSQL_INCLUDE_DIR "/usr/local/opt/mysql-client/include")
-      include_sub_directories_recursively(/usr/local/opt/mysql-client/include)
-  endif()
-  
-  if (IS_DIRECTORY "/opt/homebrew/opt/mysql")
-        MESSAGE( STATUS "/opt/homebrew/opt/mysql")
-      set(MYSQL_INCLUDE_DIR "/opt/homebrew/opt/mysql/include")
-      include_sub_directories_recursively(/opt/homebrew/opt/mysql/include)
-  endif()
-  
-  
-  if (IS_DIRECTORY "/opt/homebrew/opt/mysql-client")
-        MESSAGE( STATUS "/opt/homebrew/opt/mysql-client")
-      set(MYSQL_INCLUDE_DIR "/opt/homebrew/opt/mysql-client/include")
-      include_sub_directories_recursively(/opt/homebrew/opt/mysql-client/include)
-  endif()
-  MESSAGE( STATUS "MYSQL_ROOT_DIR = ${MYSQL_ROOT_DIR} ")
-else()  
- find_path(MYSQL_ROOT_DIR mysql)
-endif()
-
-
-FIND_PATH(MYSQL_INCLUDE_DIR NAMES mysql.h
-  PATHS /usr/local/include/mysql /usr/include/mysql /opt/homebrew/opt/mysql/include /usr/local/opt/mysql-client/include /opt/homebrew/opt/mysql-client/include
-)
-
-MESSAGE( STATUS "MYSQL_ROOT_DIR = ${MYSQL_ROOT_DIR} ")
-find_package_handle_standard_args(mysql REQUIRED_VARS MYSQL_ROOT_DIR)
-
-
-if(NOT MYSQL_INCLUDE_DIR)
-  message(STATUS "Could not find \"mysql.h\" from searching ")
-endif()
-
-SET(MYSQL_NAMES mysqlclient)
-FIND_LIBRARY(MYSQL_LIBRARY
-  NAMES ${MYSQL_NAMES}
-  PATHS /usr/lib /usr/local/lib /usr/local/mysql/lib /usr/local/opt/mysql/lib /opt/homebrew/opt/mysql/lib /opt/homebrew/opt/mysql-client/lib
-  PATH_SUFFIXES mysql
-)
-
-IF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
-  SET(MYSQL_FOUND TRUE)
-  SET( MYSQL_LIBRARIES ${MYSQL_LIBRARY} )
-ELSE (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
-  SET(MYSQL_FOUND FALSE)
-  SET( MYSQL_LIBRARIES )
-ENDIF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
-
-IF (MYSQL_FOUND)
-  IF (NOT MYSQL_FIND_QUIETLY)
-    MESSAGE(STATUS "Found MySQL: ${MYSQL_LIBRARY}")
-  ENDIF (NOT MYSQL_FIND_QUIETLY)
-ELSE (MYSQL_FOUND)
-  IF (MYSQL_FIND_REQUIRED)
-    MESSAGE(STATUS "Looked for MySQL libraries named ${MYSQL_NAMES}.")
-    MESSAGE(FATAL_ERROR "Could NOT find MySQL library")
-  ENDIF (MYSQL_FIND_REQUIRED)
-ENDIF (MYSQL_FOUND)
-
-target_include_directories(paozhu PUBLIC ${MYSQL_INCLUDE_DIR})
-target_link_libraries(paozhu ${MYSQL_LIBRARY})
-
-target_include_directories(paozhu_cli PUBLIC ${MYSQL_INCLUDE_DIR})
-target_link_libraries(paozhu_cli ${MYSQL_LIBRARY})
+#if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+#  if (IS_DIRECTORY "/usr/local/mysql/include")
+# MESSAGE( STATUS "/usr/local/mysql")
+#     set(MYSQL_INCLUDE_DIR "/usr/local/mysql/include")
+#     include_sub_directories_recursively(/usr/local/mysql/include)
+# endif()
+#
+# if (IS_DIRECTORY "/usr/local/opt/mysql-client")
+#       MESSAGE( STATUS "/usr/local/opt/mysql-client")
+#     set(MYSQL_INCLUDE_DIR "/usr/local/opt/mysql-client/include")
+#     include_sub_directories_recursively(/usr/local/opt/mysql-client/include)
+# endif()
+# 
+# if (IS_DIRECTORY "/opt/homebrew/opt/mysql")
+#       MESSAGE( STATUS "/opt/homebrew/opt/mysql")
+#     set(MYSQL_INCLUDE_DIR "/opt/homebrew/opt/mysql/include")
+#     include_sub_directories_recursively(/opt/homebrew/opt/mysql/include)
+# endif()
+#   
+#   
+#   if (IS_DIRECTORY "/opt/homebrew/opt/mysql-client")
+#         MESSAGE( STATUS "/opt/homebrew/opt/mysql-client")
+#       set(MYSQL_INCLUDE_DIR "/opt/homebrew/opt/mysql-client/include")
+#       include_sub_directories_recursively(/opt/homebrew/opt/mysql-client/include)
+#   endif()
+#   MESSAGE( STATUS "MYSQL_ROOT_DIR = ${MYSQL_ROOT_DIR} ")
+#else()  
+#  find_path(MYSQL_ROOT_DIR mysql)
+#endif()
+# 
+# 
+# FIND_PATH(MYSQL_INCLUDE_DIR NAMES mysql.h
+#   PATHS /usr/local/include/mysql /usr/include/mysql /opt/homebrew/opt/mysql/include /usr/local/opt/mysql-client/include /opt/homebrew/opt/mysql-client/include
+# )
+# 
+# MESSAGE( STATUS "MYSQL_ROOT_DIR = ${MYSQL_ROOT_DIR} ")
+# find_package_handle_standard_args(mysql REQUIRED_VARS MYSQL_ROOT_DIR)
+# 
+# 
+# if(NOT MYSQL_INCLUDE_DIR)
+#   message(STATUS "Could not find \"mysql.h\" from searching ")
+# endif()
+# 
+# SET(MYSQL_NAMES mysqlclient)
+# FIND_LIBRARY(MYSQL_LIBRARY
+#   NAMES ${MYSQL_NAMES}
+#   PATHS /usr/lib /usr/local/lib /usr/local/mysql/lib /usr/local/opt/mysql/lib /opt/homebrew/opt/mysql/lib /opt/homebrew/opt/mysql-client/lib
+#   PATH_SUFFIXES mysql
+# )
+# 
+# IF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
+#   SET(MYSQL_FOUND TRUE)
+#   SET( MYSQL_LIBRARIES ${MYSQL_LIBRARY} )
+# ELSE (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
+#   SET(MYSQL_FOUND FALSE)
+#   SET( MYSQL_LIBRARIES )
+# ENDIF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
+# 
+# IF (MYSQL_FOUND)
+#   IF (NOT MYSQL_FIND_QUIETLY)
+#     MESSAGE(STATUS "Found MySQL: ${MYSQL_LIBRARY}")
+#   ENDIF (NOT MYSQL_FIND_QUIETLY)
+# ELSE (MYSQL_FOUND)
+#   IF (MYSQL_FIND_REQUIRED)
+#     MESSAGE(STATUS "Looked for MySQL libraries named ${MYSQL_NAMES}.")
+#     MESSAGE(FATAL_ERROR "Could NOT find MySQL library")
+#   ENDIF (MYSQL_FIND_REQUIRED)
+# ENDIF (MYSQL_FOUND)
+# 
+# target_include_directories(paozhu PUBLIC ${MYSQL_INCLUDE_DIR})
+# target_link_libraries(paozhu ${MYSQL_LIBRARY})
+# 
+# target_include_directories(paozhu_cli PUBLIC ${MYSQL_INCLUDE_DIR})
+# target_link_libraries(paozhu_cli ${MYSQL_LIBRARY})
 
 
 
 
 
 

+ 21 - 6
frameworks/C++/paozhu/paozhu_benchmark/common/autocontrolmethod.hpp

@@ -9,14 +9,21 @@
 #include "httppeer.h" 
 #include "httppeer.h" 
 
 
 #include "techempower.h"
 #include "techempower.h"
+ 
+namespace http
+{ 
+     
+    void _initauto_control_httpmethodregto(std::map<std::string, regmethold_t> &methodcallback)
+    {
+        struct regmethold_t temp;
 
 
 
 
-namespace http
-{
-  void _initauto_control_httpmethodregto(std::map<std::string, regmethold_t> &methodcallback)
-  {
-    struct regmethold_t temp;
 
 
+    }
+    
+    void _initauto_co_control_httpmethodregto(std::map<std::string, regmethold_co_t> &methodcallback)
+    {
+        struct regmethold_co_t temp;
 		temp.pre = nullptr;
 		temp.pre = nullptr;
 		temp.regfun = techempowerplaintext;
 		temp.regfun = techempowerplaintext;
 		methodcallback.emplace("plaintext",temp);
 		methodcallback.emplace("plaintext",temp);
@@ -54,8 +61,16 @@ namespace http
 
 
     }
     }
     
     
-}
+    void _initauto_co_domain_httpmethodregto(std::map<std::string, std::map<std::string, regmethold_co_t>> &domain_methodcallback)
+    {
+        struct regmethold_co_t temp;
+        std::map<std::string, regmethold_co_t> methodcallback;
+        std::map<std::string, std::map<std::string, regmethold_co_t>>::iterator domain_iterator;
+    
 
 
+    }
+        
+}    
 #endif
 #endif
 
 
     
     

+ 3 - 0
frameworks/C++/paozhu/paozhu_benchmark/common/cost_define.h

@@ -6,4 +6,7 @@
 #define CONST_HTTP_HEADER_BODY_SIZE 16384
 #define CONST_HTTP_HEADER_BODY_SIZE 16384
 #define CONST_PHP_BODY_POST_SIZE 16777216
 #define CONST_PHP_BODY_POST_SIZE 16777216
 
 
+#define CONST_HTTP_BODY_POST_SIZE 33554432
+#define CONST_HTTP_JSON_POST_SIZE 2097152
+
 #endif
 #endif

+ 13 - 2
frameworks/C++/paozhu/paozhu_benchmark/common/httphook.cpp

@@ -8,13 +8,24 @@
 #include <memory>
 #include <memory>
 #include <string_view>
 #include <string_view>
 #include "httppeer.h"
 #include "httppeer.h"
+#include "client_session.h"
 namespace http
 namespace http
 {
 {
 std::map<std::string, bool> _block_ip_tables;
 std::map<std::string, bool> _block_ip_tables;
 std::map<std::string, bool> _block_host_tables;
 std::map<std::string, bool> _block_host_tables;
-bool check_blockip(const std::string &client_ip)
+std::map<std::string, bool> _passport_ip_tables;
+std::map<std::string, bool> _passport_host_tables;
+bool check_blockip(std::shared_ptr<client_session> peer_session)
 {
 {
-    if (client_ip.size() > 0)
+    if (peer_session->isssl)
+    {
+        return false;
+    }
+    return false;
+}
+bool check_pressl_blockip(std::shared_ptr<client_session> peer_session)
+{
+    if (peer_session->isssl)
     {
     {
         return false;
         return false;
     }
     }

+ 4 - 2
frameworks/C++/paozhu/paozhu_benchmark/conf/orm.conf

@@ -6,7 +6,8 @@ dbname=hello_world
 user=benchmarkdbuser
 user=benchmarkdbuser
 password=benchmarkdbpass
 password=benchmarkdbpass
 pretable=
 pretable=
-maxpool=5
+maxpool=120
+minpool=30
 dbtype=mysql
 dbtype=mysql
 
 
 type=second
 type=second
@@ -16,5 +17,6 @@ dbname=hello_world
 user=benchmarkdbuser
 user=benchmarkdbuser
 password=benchmarkdbpass
 password=benchmarkdbpass
 pretable=
 pretable=
-maxpool=20
+maxpool=120
+minpool=30
 dbtype=mysql
 dbtype=mysql

+ 11 - 11
frameworks/C++/paozhu/paozhu_benchmark/conf/server.conf

@@ -18,19 +18,19 @@ clean_cron  =m5t600 ;5-minute interval clean 600 seconds ago inactive connection
 links_restart_process =n9998877ts1te5 ;More than 15000 connections, restart the process from 1:00 am to 5:00 am
 links_restart_process =n9998877ts1te5 ;More than 15000 connections, restart the process from 1:00 am to 5:00 am
 session_type=1 ;session save type 0.file 1.memory 2.redis 3.memcache 4.reserve
 session_type=1 ;session save type 0.file 1.memory 2.redis 3.memcache 4.reserve
 static_file_compress_cache=1 ;1 enable, Cache static file compress(gzip,br) content to cache directory 
 static_file_compress_cache=1 ;1 enable, Cache static file compress(gzip,br) content to cache directory 
-modelspath=/root/benchmark/models
-serverpath=/root/benchmark
-viewpath=/root/benchmark/view
-viewsopath=/root/benchmark/module/view
+modelspath=/paozhu/models
+serverpath=/paozhu
+viewpath=/paozhu/view
+viewsopath=/paozhu/module/view
 
 
-controlpath=/root/benchmark/controller
-controlsopath=/root/benchmark/module/controller
+controlpath=/paozhu/controller
+controlsopath=/paozhu/module/controller
 
 
-temppath=/root/benchmark/temp
-logpath=/root/benchmark/log
-wwwpath=/root/benchmark/www/default
-pluginspath=/root/benchmark/plugins
-libspath=/root/benchmark/libs
+temppath=/paozhu/temp
+logpath=/paozhu/log
+wwwpath=/paozhu/www/default
+pluginspath=/paozhu/plugins
+libspath=/paozhu/libs
 directorylist=0
 directorylist=0
 index=index.html
 index=index.html
 ;usehtmlcache=1
 ;usehtmlcache=1

+ 9 - 11
frameworks/C++/paozhu/paozhu_benchmark/controller/include/techempower.h

@@ -5,15 +5,13 @@
 #include "httppeer.h"
 #include "httppeer.h"
 
 
 namespace http
 namespace http
-{
-
-            
-	std::string techempowerplaintext(std::shared_ptr<httppeer> peer);
-	std::string techempowerjson(std::shared_ptr<httppeer> peer);
-	std::string techempowerdb(std::shared_ptr<httppeer> peer);
-	std::string techempowerqueries(std::shared_ptr<httppeer> peer);
-	std::string techempowerfortunes(std::shared_ptr<httppeer> peer);
-	std::string techempowerupdates(std::shared_ptr<httppeer> peer);
-	std::string techempowercached_queries(std::shared_ptr<httppeer> peer);
-	std::string techempowercached_db(std::shared_ptr<httppeer> peer);
+{        
+	asio::awaitable<std::string> techempowerplaintext(std::shared_ptr<httppeer> peer);
+	asio::awaitable<std::string> techempowerjson(std::shared_ptr<httppeer> peer);
+	asio::awaitable<std::string> techempowerdb(std::shared_ptr<httppeer> peer);
+	asio::awaitable<std::string> techempowerqueries(std::shared_ptr<httppeer> peer);
+	asio::awaitable<std::string> techempowerfortunes(std::shared_ptr<httppeer> peer);
+	asio::awaitable<std::string> techempowerupdates(std::shared_ptr<httppeer> peer);
+	asio::awaitable<std::string> techempowercached_queries(std::shared_ptr<httppeer> peer);
+	asio::awaitable<std::string> techempowercached_db(std::shared_ptr<httppeer> peer);
 }
 }

+ 199 - 190
frameworks/C++/paozhu/paozhu_benchmark/controller/src/techempower.cpp

@@ -6,236 +6,245 @@
 #include <chrono>
 #include <chrono>
 #include "httppeer.h"
 #include "httppeer.h"
 #include "techempower.h"
 #include "techempower.h"
+#include "techempower_json.h"
 #include "datetime.h"
 #include "datetime.h"
 #include "func.h"
 #include "func.h"
 #include "pzcache.h"
 #include "pzcache.h"
 #include "json_reflect_headers.h"
 #include "json_reflect_headers.h"
-#include "techempower_json.h"
 namespace http
 namespace http
 {
 {
-    //@urlpath(null,plaintext)
-    std::string techempowerplaintext(std::shared_ptr<httppeer> peer)
+//@urlpath(null,plaintext)
+asio::awaitable<std::string> techempowerplaintext(std::shared_ptr<httppeer> peer)
+{
+    peer->type("text/plain; charset=UTF-8");
+    peer->set_header("Date", get_gmttime());
+    peer->output = "Hello, World!";
+    co_return "";
+}
+
+//@urlpath(null,json)
+asio::awaitable<std::string> techempowerjson(std::shared_ptr<httppeer> peer)
+{
+    peer->type("application/json; charset=UTF-8");
+    peer->set_header("Date", get_gmttime());
+    struct techempower_outjson_t a;
+    a.message    = "Hello, World!";
+    peer->output = json_encode(a);
+    co_return "";
+}
+
+//@urlpath(null,db)
+asio::awaitable<std::string> techempowerdb(std::shared_ptr<httppeer> peer)
+{
+    peer->type("application/json; charset=UTF-8");
+    peer->set_header("Date", get_gmttime());
+    auto myworld        = orm::World();
+    unsigned int rd_num = rand_range(1, 10000);
+    myworld.where("id", rd_num);
+    myworld.limit(1);
+    co_await myworld.async_fetch_one();
+    peer->output = myworld.data_tojson();
+    co_return "";
+}
+
+//@urlpath(null,queries)
+asio::awaitable<std::string> techempowerqueries(std::shared_ptr<httppeer> peer)
+{
+    peer->type("application/json; charset=UTF-8");
+    peer->set_header("Date", get_gmttime());
+
+    unsigned int get_num = peer->get["queries"].to_int();
+    if (get_num == 0)
     {
     {
-        peer->type("text/plain; charset=UTF-8");
-        peer->set_header("Date", get_gmttime());
-        peer->output = "Hello, World!";
-        return "";
+        get_num = 1;
     }
     }
-
-    //@urlpath(null,json)
-    std::string techempowerjson(std::shared_ptr<httppeer> peer)
+    else if (get_num > 500)
     {
     {
-        peer->type("application/json; charset=UTF-8");
-        peer->set_header("Date", get_gmttime());
-        struct techempower_outjson_t a;
-        a.message = "Hello, World!";
-        peer->output = json_encode(a);
-        return "";
+        get_num = 500;
     }
     }
-
-    //@urlpath(null,db)
-    std::string techempowerdb(std::shared_ptr<httppeer> peer)
+    auto myworld = orm::World();
+    myworld.record.reserve(get_num);
+    for (unsigned int i = 0; i < get_num; i++)
     {
     {
-        peer->type("application/json; charset=UTF-8");
-        peer->set_header("Date", get_gmttime());
-        auto myworld = orm::World();
+        myworld.wheresql.clear();
         unsigned int rd_num = rand_range(1, 10000);
         unsigned int rd_num = rand_range(1, 10000);
-        myworld.get_one(rd_num);
-
-        peer->output = myworld.data_tojson();
-        return "";
+        myworld.where("id", rd_num);
+        co_await myworld.async_fetch_append();
     }
     }
 
 
-    //@urlpath(null,queries)
-    std::string techempowerqueries(std::shared_ptr<httppeer> peer)
-    {
-        peer->type("application/json; charset=UTF-8");
-        peer->set_header("Date", get_gmttime());
+    peer->output = myworld.to_json();
+    co_return "";
+}
 
 
-        unsigned int get_num = peer->get["queries"].to_int();
-        if (get_num == 0)
-        {
-            get_num = 1;
-        }
-        else if (get_num > 500)
-        {
-            get_num = 500;
-        }
-        auto myworld = orm::World();
-        myworld.record.reserve(get_num);
-        for (unsigned int i = 0; i < get_num; i++)
-        {
-            myworld.wheresql.clear();
-            unsigned int rd_num = rand_range(1, 10000);
-            myworld.where("id", rd_num).fetch_append();
-        }
-
-        peer->output = myworld.to_json();
-        return "";
+//@urlpath(null,fortunes)
+asio::awaitable<std::string> techempowerfortunes(std::shared_ptr<httppeer> peer)
+{
+    peer->type("text/html; charset=UTF-8");
+    peer->set_header("Date", get_gmttime());
+
+    auto myfortune = orm::Fortune();
+    co_await myfortune.async_fetch();
+    myfortune.data.id      = 0;
+    myfortune.data.message = "Additional fortune added at request time.";
+    myfortune.record.push_back(myfortune.data);
+
+    std::sort(myfortune.record.begin(), myfortune.record.end(), [](const auto &lhs, const auto &rhs)
+              { return lhs.message < rhs.message; });
+    peer->val["list"].set_array();
+    OBJ_ARRAY item;
+    for (unsigned int i = 0; i < myfortune.record.size(); i++)
+    {
+        item["id"]      = myfortune.record[i].id;
+        item["message"] = html_encode(myfortune.record[i].message);
+        peer->val["list"].push(item);
     }
     }
+    peer->view("techempower/fortunes");
+    // peer->output = "<!DOCTYPE html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr>";
+    // for (unsigned int i = 0; i < myfortune.record.size(); i++)
+    // {
+    //     peer->output += "<tr><td>" + std::to_string(myfortune.record[i].id) + "</td><td>" + html_encode(myfortune.record[i].message) + "</td></tr>";
+    // }
+    // peer->output += "</table></body></html>";
+    co_return "";
+}
+
+//@urlpath(null,updates)
+asio::awaitable<std::string> techempowerupdates(std::shared_ptr<httppeer> peer)
+{
+    peer->type("application/json; charset=UTF-8");
+    peer->set_header("Date", get_gmttime());
+    unsigned int get_num = peer->get["queries"].to_int();
 
 
-    //@urlpath(null,fortunes)
-    std::string techempowerfortunes(std::shared_ptr<httppeer> peer)
+    if (get_num == 0)
     {
     {
-        peer->type("text/html; charset=UTF-8");
-        peer->set_header("Date", get_gmttime());
-
-        auto myfortune = orm::Fortune();
-        myfortune.fetch();
-        myfortune.data.id = 0;
-        myfortune.data.message = "Additional fortune added at request time.";
-        myfortune.record.push_back(myfortune.data);
-
-        std::sort(myfortune.record.begin(), myfortune.record.end(), [](const auto &lhs, const auto &rhs)
-                  { return lhs.message < rhs.message; });
-        peer->val["list"].set_array();
-        OBJ_ARRAY item;
-        for (unsigned int i = 0; i < myfortune.record.size(); i++)
-        {
-            item["id"] = myfortune.record[i].id;
-            item["message"] = html_encode(myfortune.record[i].message);
-            peer->val["list"].push(item);
-        }
-
-        peer->view("techempower/fortunes");
-        return "";
+        get_num = 1;
     }
     }
-
-    //@urlpath(null,updates)
-    std::string techempowerupdates(std::shared_ptr<httppeer> peer)
+    else if (get_num > 500)
     {
     {
-        peer->type("application/json; charset=UTF-8");
-        peer->set_header("Date", get_gmttime());
-        unsigned int get_num = peer->get["queries"].to_int();
-
-        if (get_num == 0)
-        {
-            get_num = 1;
-        }
-        else if (get_num > 500)
-        {
-            get_num = 500;
-        }
-        auto myworld = orm::World();
-        myworld.record.clear();
-        myworld.record.reserve(get_num);
-        for (unsigned int i = 0; i < get_num; i++)
+        get_num = 500;
+    }
+    auto myworld = orm::World();
+    myworld.record.clear();
+    myworld.record.reserve(get_num);
+    for (unsigned int i = 0; i < get_num; i++)
+    {
+        myworld.wheresql.clear();
+        myworld.where("id", rand_range(1, 10000));
+        co_await myworld.async_fetch_append();
+        if (myworld.effect() > 0)
         {
         {
-            myworld.wheresql.clear();
-            myworld.where("id", rand_range(1, 10000)).fetch_append();
-            if (myworld.effect() > 0)
-            {
-                unsigned int j = myworld.record.size() - 1;
-                myworld.data.randomnumber = rand_range(1, 10000);
-                myworld.record[j].randomnumber = myworld.data.randomnumber;
-                myworld.update("randomnumber");
-            }
+            unsigned int j                 = myworld.record.size() - 1;
+            myworld.data.randomnumber      = rand_range(1, 10000);
+            myworld.record[j].randomnumber = myworld.data.randomnumber;
+            co_await myworld.async_update("randomnumber");
         }
         }
-        peer->output = myworld.to_json();
-        return "";
     }
     }
+    peer->output = myworld.to_json();
+    co_return "";
+}
 
 
-    //@urlpath(null,cached-queries)
-    std::string techempowercached_queries(std::shared_ptr<httppeer> peer)
-    {
-        peer->type("application/json; charset=UTF-8");
-        peer->set_header("Date", get_gmttime());
+//@urlpath(null,cached-queries)
+asio::awaitable<std::string> techempowercached_queries(std::shared_ptr<httppeer> peer)
+{
+    peer->type("application/json; charset=UTF-8");
+    peer->set_header("Date", get_gmttime());
 
 
-        unsigned int get_num = peer->get["count"].to_int();
-        if (get_num == 0)
-        {
-            get_num = 1;
-        }
-        else if (get_num > 500)
-        {
-            get_num = 500;
-        }
-        auto myworld = orm::World();
-        std::string mycacheid = "alldatacache";
+    unsigned int get_num = peer->get["count"].to_int();
+    if (get_num == 0)
+    {
+        get_num = 1;
+    }
+    else if (get_num > 500)
+    {
+        get_num = 500;
+    }
+    auto myworld          = orm::World();
+    std::string mycacheid = "alldatacache";
 
 
-        pzcache<std::vector<orm::worldbase::meta>> &temp_cache = pzcache<std::vector<orm::worldbase::meta>>::conn();
+    pzcache<std::vector<orm::worldbase::meta>> &temp_cache = pzcache<std::vector<orm::worldbase::meta>>::conn();
 
 
-        std::vector<orm::worldbase::meta> allcachedata_array;
-        allcachedata_array.reserve(10000);
-        // create rand data to cache
-        if (temp_cache.check(mycacheid) > -1)
-        {
-            allcachedata_array = temp_cache.get(mycacheid);
-        }
-        else
-        {
-            allcachedata_array.resize(10000);
-            for (unsigned int i = 0; i < 10000; i++)
-            {
-                allcachedata_array[i].id = i + 1;
-                allcachedata_array[i].randomnumber = rand_range(1, 10000);
-            }
-            temp_cache.save(mycacheid, allcachedata_array, 120);
-        }
-        // get rand data from cache
-        mycacheid = "my" + std::to_string(get_num);
-        myworld.record.reserve(get_num);
-        if (temp_cache.check(mycacheid) > -1)
+    std::vector<orm::worldbase::meta> allcachedata_array;
+    allcachedata_array.reserve(10000);
+    //create rand data to cache
+    if (temp_cache.check(mycacheid) > -1)
+    {
+        allcachedata_array = temp_cache.get(mycacheid);
+    }
+    else
+    {
+        allcachedata_array.resize(10000);
+        for (unsigned int i = 0; i < 10000; i++)
         {
         {
-            myworld.record = temp_cache.get(mycacheid);
+            allcachedata_array[i].id           = i + 1;
+            allcachedata_array[i].randomnumber = rand_range(1, 10000);
         }
         }
-        else
+        temp_cache.save(mycacheid, allcachedata_array, 360);
+    }
+    //get rand data from cache
+    mycacheid = "my" + std::to_string(get_num);
+    myworld.record.reserve(get_num);
+    if (temp_cache.check(mycacheid) > -1)
+    {
+        myworld.record = temp_cache.get(mycacheid);
+    }
+    else
+    {
+        if (allcachedata_array.size() == 10000)
         {
         {
-            if (allcachedata_array.size() == 10000)
+            for (unsigned int i = 0; i < get_num; i++)
             {
             {
-                for (unsigned int i = 0; i < get_num; i++)
-                {
-                    unsigned int temp_rid = rand_range(0, 9999);
-                    myworld.record.push_back(allcachedata_array[temp_rid]);
-                }
+                unsigned int temp_rid = rand_range(0, 9999);
+                myworld.record.push_back(allcachedata_array[temp_rid]);
             }
             }
-            temp_cache.save(mycacheid, myworld.record, 120);
         }
         }
-
-        peer->output = myworld.to_json();
-        return "";
+        temp_cache.save(mycacheid, myworld.record, 360);
     }
     }
 
 
-    //@urlpath(null,cached-db)
-    std::string techempowercached_db(std::shared_ptr<httppeer> peer)
+    peer->output = myworld.to_json();
+    co_return "";
+}
+
+//@urlpath(null,cached-db)
+asio::awaitable<std::string> techempowercached_db(std::shared_ptr<httppeer> peer)
+{
+    peer->type("application/json; charset=UTF-8");
+    peer->set_header("Date", get_gmttime());
+    //this test from database to cache
+    unsigned int get_num = peer->get["count"].to_int();
+    if (get_num == 0)
     {
     {
-        peer->type("application/json; charset=UTF-8");
-        peer->set_header("Date", get_gmttime());
-        // this test from database to cache
-        unsigned int get_num = peer->get["count"].to_int();
-        if (get_num == 0)
-        {
-            get_num = 1;
-        }
-        else if (get_num > 500)
-        {
-            get_num = 500;
-        }
-        auto myworld = orm::World();
-        std::string mycacheid = "my" + std::to_string(get_num);
+        get_num = 1;
+    }
+    else if (get_num > 500)
+    {
+        get_num = 500;
+    }
+    auto myworld          = orm::World();
+    std::string mycacheid = "my" + std::to_string(get_num);
 
 
-        pzcache<std::vector<orm::worldbase::meta>> &temp_cache = pzcache<std::vector<orm::worldbase::meta>>::conn();
+    pzcache<std::vector<orm::worldbase::meta>> &temp_cache = pzcache<std::vector<orm::worldbase::meta>>::conn();
 
 
-        myworld.record.reserve(get_num);
-        if (temp_cache.check(mycacheid) > -1)
-        {
-            myworld.record = temp_cache.get(mycacheid);
-        }
-        else
+    myworld.record.reserve(get_num);
+    if (temp_cache.check(mycacheid) > -1)
+    {
+        myworld.record = temp_cache.get(mycacheid);
+    }
+    else
+    {
+        std::vector<unsigned int> cacheid;
+        for (unsigned int i = 0; i < get_num; i++)
         {
         {
-            std::vector<unsigned int> cacheid;
-            for (unsigned int i = 0; i < get_num; i++)
-            {
-                cacheid.push_back(rand_range(1, 10000));
-            }
-
-            std::string sqlstr = array_to_sql(cacheid);
-            myworld.whereIn("id", sqlstr).fetch();
-            temp_cache.save(mycacheid, myworld.record, 120);
+            cacheid.push_back(rand_range(1, 10000));
         }
         }
 
 
-        peer->output = myworld.to_json();
-        return "";
+        std::string sqlstr = array_to_sql(cacheid);
+        myworld.whereIn("id", sqlstr);
+        co_await myworld.async_fetch();
+        temp_cache.save(mycacheid, myworld.record, 360);
     }
     }
 
 
-} // namespace http
+    peer->output = myworld.to_json();
+    co_return "";
+}
+
+}// namespace http

+ 7 - 7
frameworks/C++/paozhu/paozhu_benchmark/models/Fortune.cpp

@@ -1,4 +1,5 @@
-#include "mysqlmodel.hpp" 
+
+#include "fortune_mysql.h"
 #include "fortunebase.h"
 #include "fortunebase.h"
 #include "Fortune.h"
 #include "Fortune.h"
 
 
@@ -7,10 +8,9 @@
 
 
 	 
 	 
  namespace orm{
  namespace orm{
- 
-
-			 Fortune::Fortune(std::string dbtag):mysqlclientDB(dbtag){}
-			 Fortune::Fortune():mysqlclientDB(){}
-
-
+ 
+			 Fortune::Fortune(std::string dbtag):fortune_mysql(dbtag){ mod=this; }
+			 Fortune::Fortune():fortune_mysql(){ mod=this; }
+
+
 	  }
 	  }

+ 7 - 7
frameworks/C++/paozhu/paozhu_benchmark/models/World.cpp

@@ -1,4 +1,5 @@
-#include "mysqlmodel.hpp" 
+
+#include "world_mysql.h"
 #include "worldbase.h"
 #include "worldbase.h"
 #include "World.h"
 #include "World.h"
 
 
@@ -7,10 +8,9 @@
 
 
 	 
 	 
  namespace orm{
  namespace orm{
- 
-
-			 World::World(std::string dbtag):mysqlclientDB(dbtag){}
-			 World::World():mysqlclientDB(){}
-
-
+ 
+			 World::World(std::string dbtag):world_mysql(dbtag){ mod=this; }
+			 World::World():world_mysql(){ mod=this; }
+
+
 	  }
 	  }

+ 3 - 3
frameworks/C++/paozhu/paozhu_benchmark/models/include/Fortune.h

@@ -1,16 +1,16 @@
 #ifndef ORM_DEFAULT_FORTUNE_H
 #ifndef ORM_DEFAULT_FORTUNE_H
 #define ORM_DEFAULT_FORTUNE_H
 #define ORM_DEFAULT_FORTUNE_H
-#include "mysqlmodel.hpp" 
+#include "fortune_mysql.h" 
 #include "fortunebase.h"
 #include "fortunebase.h"
 
 
 /* 如果此文件存在不会自动覆盖,没有则会自动生成。
 /* 如果此文件存在不会自动覆盖,没有则会自动生成。
 *If this file exists, it will not be overwritten automatically. If not, it will be generated automatically. */
 *If this file exists, it will not be overwritten automatically. If not, it will be generated automatically. */
 
 
  namespace orm {
  namespace orm {
-		class Fortune : public mysqlclientDB<Fortune,fortunebase>{
+		class Fortune : public fortune_mysql<Fortune,fortunebase>{
 		 public:
 		 public:
 		 Fortune(std::string dbtag);
 		 Fortune(std::string dbtag);
 		 Fortune();
 		 Fortune();
 		};
 		};
-};
+}
 #endif
 #endif

+ 3 - 3
frameworks/C++/paozhu/paozhu_benchmark/models/include/World.h

@@ -1,16 +1,16 @@
 #ifndef ORM_DEFAULT_WORLD_H
 #ifndef ORM_DEFAULT_WORLD_H
 #define ORM_DEFAULT_WORLD_H
 #define ORM_DEFAULT_WORLD_H
-#include "mysqlmodel.hpp" 
+#include "world_mysql.h" 
 #include "worldbase.h"
 #include "worldbase.h"
 
 
 /* 如果此文件存在不会自动覆盖,没有则会自动生成。
 /* 如果此文件存在不会自动覆盖,没有则会自动生成。
 *If this file exists, it will not be overwritten automatically. If not, it will be generated automatically. */
 *If this file exists, it will not be overwritten automatically. If not, it will be generated automatically. */
 
 
  namespace orm {
  namespace orm {
-		class World : public mysqlclientDB<World,worldbase>{
+		class World : public world_mysql<World,worldbase>{
 		 public:
 		 public:
 		 World(std::string dbtag);
 		 World(std::string dbtag);
 		 World();
 		 World();
 		};
 		};
-};
+}
 #endif
 #endif

+ 9788 - 0
frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortune_mysql.h

@@ -0,0 +1,9788 @@
+#ifndef _ORM_DEFAULT_FORTUNE_OPERATE_H
+#define _ORM_DEFAULT_FORTUNE_OPERATE_H
+
+#include <iostream>
+#include <mutex>
+#include <string>
+#include <map>
+#include <set>
+#include <string_view>
+#include <thread>
+#include "request.h"
+#include "unicode.h"
+#include "datetime.h"
+#include <stdexcept>
+#include <iostream>
+#include <functional>
+#include <tuple>
+#include <typeinfo>
+#include <memory>
+#include <list>
+#include <queue>
+#include <cmath>
+#include <condition_variable>
+#include <sstream>
+#include <algorithm>
+#include <vector>
+
+#include "mysql_conn.h"
+#include "mysql_conn_pool.h"
+#include "orm_cache.hpp"
+/*baseincludefile*/
+namespace orm
+{
+// mysql Operational SQL middleware
+/*tagnamespace*/
+//{ /*tagnamespace_replace*/
+    template <typename M_MODEL, typename B_BASE>
+    class fortune_mysql : public B_BASE
+    {
+      public:
+        fortune_mysql(const std::string &tag) : dbtag(tag)
+        {
+            std::map<std::string, std::shared_ptr<orm_conn_pool>> &conn_pool_obj = get_orm_conn_pool_obj();
+            auto iter                                                            = conn_pool_obj.find(dbtag);
+            if (iter != conn_pool_obj.end())
+            {
+                conn_obj = iter->second;
+            }
+            else
+            {
+                conn_obj  = nullptr;
+                iserror   = true;
+                error_msg = "conn_pool not found " + dbtag;
+            }
+        }
+        fortune_mysql() : dbtag(B_BASE::_rmstag)
+        {
+            std::map<std::string, std::shared_ptr<orm_conn_pool>> &conn_pool_obj = get_orm_conn_pool_obj();
+            auto iter                                                            = conn_pool_obj.find(dbtag);
+            if (iter != conn_pool_obj.end())
+            {
+                conn_obj = iter->second;
+            }
+            else
+            {
+                conn_obj  = nullptr;
+                iserror   = true;
+                error_msg = "conn_pool not found " + dbtag;
+            }
+        }
+        M_MODEL &switchDB(const std::string &temptag)
+        {
+            std::map<std::string, std::shared_ptr<orm_conn_pool>> &conn_pool_obj = get_orm_conn_pool_obj();
+            auto iter                                                            = conn_pool_obj.find(temptag);
+            if (iter != conn_pool_obj.end())
+            {
+                conn_obj = iter->second;
+            }
+            else
+            {
+                conn_obj  = nullptr;
+                iserror   = true;
+                error_msg = "conn_pool not found " + temptag;
+            }
+        }
+        M_MODEL &set_table(const std::string &table_name)
+        {
+            if (original_tablename.empty())
+            {
+                original_tablename = B_BASE::tablename;
+            }
+            if (table_name.size() > 0)
+            {
+                B_BASE::tablename = table_name;
+            }
+            return *mod;
+        }
+        M_MODEL &reset_table()
+        {
+            if (original_tablename.empty())
+            {
+                return *mod;
+            }
+            B_BASE::tablename = original_tablename;
+            return *mod;
+        }
+        unsigned int count()
+        {
+            std::string countsql;
+            countsql = "SELECT count(*) as total_countnum  FROM ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" WHERE ");
+            if (wheresql.empty())
+            {
+                countsql.append(" 1 ");
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                //std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                querysql_len = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int tempnum = 0;
+
+                                unsigned int name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                querysql_len = 0;
+                                for (unsigned int ik = 0; ik < name_length; ik++)
+                                {
+                                    if (temp_pack_data.data[tempnum] >= '0' && temp_pack_data.data[tempnum] <= '9')
+                                    {
+                                        querysql_len = querysql_len * 10 + (temp_pack_data.data[tempnum] - '0');
+                                    }
+                                    tempnum++;
+                                }
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return querysql_len;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                return 0;
+            }
+
+            return 0;
+        }
+        std::tuple<unsigned int, unsigned int, unsigned int, unsigned int>
+        page(unsigned int page, unsigned int per_page = 10, unsigned int list_num = 5)
+        {
+            unsigned int total_page = count();
+            if (per_page == 0)
+            {
+                per_page = 10;
+            }
+            if (list_num < 1)
+            {
+                list_num = 1;
+            }
+            total_page = std::ceil((float)total_page / per_page);
+
+            if (total_page < 1)
+            {
+                total_page = 1;
+            }
+            if (page > total_page)
+            {
+                page = total_page;
+            }
+            if (page < 1)
+            {
+                page = 1;
+            }
+            unsigned int mid_num  = std::floor(list_num / 2);
+            unsigned int last_num = list_num - 1;
+
+            int temp_num = page - mid_num;
+
+            unsigned int minpage = temp_num < 1 ? 1 : temp_num;
+            unsigned int maxpage = minpage + last_num;
+
+            if (maxpage > total_page)
+            {
+                maxpage  = total_page;
+                temp_num = (maxpage - last_num);
+                if (temp_num < 1)
+                {
+                    minpage = 1;
+                }
+                else
+                {
+                    minpage = temp_num;
+                }
+            }
+            limit((page - 1) * per_page, per_page);
+            return std::make_tuple(minpage, maxpage, page, total_page);
+        }
+        asio::awaitable<unsigned int> async_count()
+        {
+            std::string countsql;
+            countsql = "SELECT count(*) as total_countnum  FROM ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" WHERE ");
+            if (wheresql.empty())
+            {
+                countsql.append(" 1 ");
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                //std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                querysql_len = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int tempnum = 0;
+
+                                unsigned int name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                querysql_len = 0;
+                                for (unsigned int ik = 0; ik < name_length; ik++)
+                                {
+                                    if (temp_pack_data.data[tempnum] >= '0' && temp_pack_data.data[tempnum] <= '9')
+                                    {
+                                        querysql_len = querysql_len * 10 + (temp_pack_data.data[tempnum] - '0');
+                                    }
+                                    tempnum++;
+                                }
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return querysql_len;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                co_return 0;
+            }
+            co_return 0;
+        }
+
+        asio::awaitable<std::tuple<unsigned int, unsigned int, unsigned int, unsigned int>>
+        async_page(unsigned int page, unsigned int per_page = 10, unsigned int list_num = 5)
+        {
+            unsigned int total_page = async_count();
+            if (per_page == 0)
+            {
+                per_page = 10;
+            }
+            if (list_num < 1)
+            {
+                list_num = 1;
+            }
+            total_page = std::ceil((float)total_page / per_page);
+
+            if (total_page < 1)
+            {
+                total_page = 1;
+            }
+            if (page > total_page)
+            {
+                page = total_page;
+            }
+            if (page < 1)
+            {
+                page = 1;
+            }
+            unsigned int mid_num  = std::floor(list_num / 2);
+            unsigned int last_num = list_num - 1;
+
+            int temp_num = page - mid_num;
+
+            unsigned int minpage = temp_num < 1 ? 1 : temp_num;
+            unsigned int maxpage = minpage + last_num;
+
+            if (maxpage > total_page)
+            {
+                maxpage  = total_page;
+                temp_num = (maxpage - last_num);
+                if (temp_num < 1)
+                {
+                    minpage = 1;
+                }
+                else
+                {
+                    minpage = temp_num;
+                }
+            }
+            limit((page - 1) * per_page, per_page);
+            co_return std::make_tuple(minpage, maxpage, page, total_page);
+        }
+
+        unsigned int update_col(std::string colname, int num, char symbol = '+')
+        {
+            effect_num = 0;
+            std::string countsql;
+            countsql = "UPDATE ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" SET ");
+            countsql.append(colname);
+            if (num > 0)
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.append(std::to_string(num));
+            }
+            else
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.push_back('(');
+                countsql.push_back('-');
+                countsql.append(std::to_string(std::abs(num)));
+                countsql.push_back(')');
+            }
+            countsql.append(" where ");
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    countsql.append(tempsql.str());
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    //insertid      = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_update_col(std::string colname, int num, char symbol = '+')
+        {
+            effect_num = 0;
+            std::string countsql;
+            countsql = "UPDATE ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" SET ");
+            countsql.append(colname);
+            if (num > 0)
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.append(std::to_string(num));
+            }
+            else
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.push_back('(');
+                countsql.push_back('-');
+                countsql.append(std::to_string(std::abs(num)));
+                countsql.push_back(')');
+            }
+            countsql.append(" where ");
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    countsql.append(tempsql.str());
+                }
+                else
+                {
+                    co_return 0;
+                }
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    //insertid      = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    co_return effect_num;
+                }
+
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            co_return 0;
+        }
+
+        int replace_col(std::string colname, const std::string &old_string, const std::string &new_string)
+        {
+            effect_num = 0;
+            std::string countsql;
+            countsql = "UPDATE ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" SET ");
+            countsql.append(colname);
+
+            countsql.append(" = REPLACE(");
+            countsql.append(colname);
+            countsql.append(",'");
+            countsql.append(old_string);
+            countsql.append("','");
+            countsql.append(new_string);
+            countsql.append("') ");
+
+            countsql.append(" where ");
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    countsql.append(tempsql.str());
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    //insertid      = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        void assign_field_value(unsigned char index_pos, unsigned char *result_temp_data, unsigned int value_size, typename B_BASE::meta &data_temp)
+    {
+        switch(index_pos)
+        {
+            case 0:
+            data_temp.id=0;
+            
+            for(unsigned int i=0; i< value_size; i++)
+            {
+                if(result_temp_data[i]>='0'&&result_temp_data[i]<='9')
+                {
+
+                data_temp.id= data_temp.id * 10 + (result_temp_data[i]-'0');
+                }   
+                if(i>32)
+                {
+                    break;
+                }
+            }
+            break;
+                case 1:
+            data_temp.message.clear();
+            data_temp.message.resize(value_size);
+            
+            std::memcpy(data_temp.message.data(), result_temp_data, value_size);
+            break;
+                
+        }
+    }
+    
+
+M_MODEL& eqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& nqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& inId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& inId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& inId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& ninId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& btId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& beId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& ltId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& leId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_eqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_nqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_inId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_ninId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_btId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_beId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ltId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_leId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& eqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& nqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& btId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& beId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& ltId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& leId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_eqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_nqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_btId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_beId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_ltId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_leId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+M_MODEL& nullMessage()
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message = NULL ");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& nnullMessage()
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message != NULL ");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& eqMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message = '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& nqMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message != '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& inMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message IN(");
+				wheresql.append(val);
+				wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& inMessage(const std::vector<std::string> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(B_BASE::stringaddslash(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& inMessage(const std::vector<T> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(std::to_string(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message NOT IN(");
+				wheresql.append(val);
+				wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninMessage(const std::vector<std::string> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(B_BASE::stringaddslash(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& ninMessage(const std::vector<T> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(std::to_string(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+M_MODEL& likeMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message LIKE '%");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.append("%'");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& l_likeMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message LIKE '%");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.append("'");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& r_likeMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message LIKE '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.append("%'");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& btMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message > '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& beMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message >= '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ltMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message < '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& leMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message <= '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_nullMessage()
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message = NULL ");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_nnullMessage()
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message != NULL ");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_eqMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message = '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_nqMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message != '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message IN(");
+				wheresql.append(val);
+				wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inMessage(const std::vector<std::string> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(B_BASE::stringaddslash(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_inMessage(const std::vector<T> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(std::to_string(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message NOT IN(");
+				wheresql.append(val);
+				wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninMessage(const std::vector<std::string> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(B_BASE::stringaddslash(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_ninMessage(const std::vector<T> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(std::to_string(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_likeMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message LIKE '%");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.append("%'");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& orl_likeMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message LIKE '%");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.append("'");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& orr_likeMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message LIKE '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.append("%'");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_btMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message > '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_beMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message >= '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ltMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message < '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_leMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message <= '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& eqMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message = '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& nqMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message != '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& btMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message > '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& beMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message >= '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& ltMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message < '");
+		wheresql.append(std::to_string(val));
+		wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& leMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message <= '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& or_eqMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message = '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& or_nqMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message != '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& or_btMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message > '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& or_beMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message >= '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& or_ltMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message < '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& or_leMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message <= '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+        M_MODEL &select(const std::string &fieldname)
+        {
+            if (selectsql.size() > 0)
+            {
+                selectsql.push_back(',');
+            }
+            selectsql.append(fieldname);
+            return *mod;
+        }
+
+        M_MODEL &where(const std::string &wq)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(wq);
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &where(const std::string &wq, _SQL_Value val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+
+        M_MODEL &where(const std::string &wq, char bi, http::OBJ_VALUE &obj)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.push_back(bi);
+            if (obj.is_string())
+            {
+                wheresql.push_back('\'');
+                wheresql.append(obj.as_string());
+                wheresql.push_back('\'');
+            }
+            else
+            {
+
+                wheresql.append(obj.to_string());
+            }
+            return *mod;
+        }
+        M_MODEL &where(const std::string &wq, http::OBJ_VALUE &obj)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            if (obj.is_string())
+            {
+                wheresql.push_back('\'');
+                wheresql.append(obj.as_string());
+                wheresql.push_back('\'');
+            }
+            else
+            {
+
+                wheresql.append(obj.to_string());
+            }
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &where(const std::string &wq, char bi, _SQL_Value val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.push_back(bi);
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+
+        M_MODEL &where(const std::string &wq, char bi, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.push_back(bi);
+            wheresql.push_back('\'');
+
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+        M_MODEL &where(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+
+        M_MODEL &between(const std::string &wq, const std::string &a, const std::string &b)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(" (");
+            wheresql.append(wq);
+            wheresql.append(" BETWEEN '");
+            std::stringstream _stream;
+            _stream << a;
+            _stream << "' AND '";
+            _stream << b;
+            _stream << "' ) ";
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &between(const std::string &wq, _SQL_Value a, _SQL_Value b)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(" (");
+            wheresql.append(wq);
+            wheresql.append(" BETWEEN ");
+            std::stringstream _stream;
+            _stream << a;
+            _stream << " AND ";
+            _stream << b;
+            _stream << " ) ";
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &orBetween(const std::string &wq, _SQL_Value a, _SQL_Value b)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(" (");
+            wheresql.append(wq);
+            wheresql.append(" BETWEEN ");
+            std::stringstream _stream;
+            _stream << a;
+            _stream << " AND ";
+            _stream << b;
+            _stream << " ) ";
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        M_MODEL &whereLike(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            if (val.size() > 0 && (val[0] == '%' || val.back() == '%'))
+            {
+                wheresql.append(val);
+                wheresql.append("' ");
+            }
+            else
+            {
+                wheresql.push_back('%');
+                wheresql.append(val);
+                wheresql.append("%' ");
+            }
+            return *mod;
+        }
+        M_MODEL &whereLikeLeft(const std::string &wq, const std::string &val)
+        {
+
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            wheresql.push_back('%');
+            wheresql.append(val);
+            wheresql.append("' ");
+            return *mod;
+        }
+        M_MODEL &whereLikeRight(const std::string &wq, const std::string &val)
+        {
+
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            wheresql.append(val);
+            wheresql.append("%' ");
+            return *mod;
+        }
+        M_MODEL &whereOrLike(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            if (val[0] == '%' || val.back() == '%')
+            {
+                wheresql.append(val);
+                wheresql.append("' ");
+            }
+            else
+            {
+                wheresql.push_back('%');
+                wheresql.append(val);
+                wheresql.append("%' ");
+            }
+            return *mod;
+        }
+        M_MODEL &whereAnd(const std::string &wq)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereAnd(const std::string &wq, _SQL_Value val)
+        {
+
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        M_MODEL &whereAnd(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+
+            return *mod;
+        }
+        M_MODEL &whereOr(const std::string &wq)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereOr(const std::string &wq, _SQL_Value val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        M_MODEL &whereOr(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+        M_MODEL &whereIn(const std::string &k)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(k);
+            return *mod;
+        }
+        M_MODEL &whereIn(const std::string &k, const std::string &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" IN(");
+            wheresql.append(a);
+            wheresql.append(") ");
+            return *mod;
+        }
+
+        M_MODEL &whereIn(const std::string &k, const std::vector<std::string> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(k);
+            wheresql.append(" in(");
+            int i = 0;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",\'");
+                }
+                else
+                {
+                    wheresql.append("\'");
+                }
+                wheresql.append(key);
+                wheresql.append("\'");
+                i++;
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+        M_MODEL &whereNotIn(const std::string &k, const std::vector<std::string> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" NOT IN(");
+            int i = 0;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",\'");
+                }
+                else
+                {
+                    wheresql.append("\'");
+                }
+                wheresql.append(key);
+                wheresql.append("\'");
+                i++;
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereIn(const std::string &k, const std::list<_SQL_Value> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" in(");
+            int i = 0;
+            std::stringstream _stream;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",");
+                }
+                _stream << key;
+                wheresql.append(_stream.str());
+                i++;
+                _stream.str("");
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereIn(const std::string &k, const std::vector<_SQL_Value> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" IN(");
+            int i = 0;
+            std::stringstream _stream;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",");
+                }
+                _stream << key;
+                wheresql.append(_stream.str());
+                i++;
+                _stream.str("");
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereNotIn(const std::string &k, const std::vector<_SQL_Value> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" NOT IN(");
+            int i = 0;
+            std::stringstream _stream;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",");
+                }
+                _stream << key;
+                wheresql.append(_stream.str());
+                i++;
+                _stream.str("");
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+
+        M_MODEL &order(const std::string &wq)
+        {
+            ordersql.append(" ORDER by ");
+            ordersql.append(wq);
+            return *mod;
+        }
+        M_MODEL &asc(const std::string &wq)
+        {
+
+            ordersql.append(" ORDER by ");
+            ordersql.append(wq);
+            ordersql.append(" ASC ");
+            return *mod;
+        }
+
+        M_MODEL &desc(const std::string &wq)
+        {
+
+            ordersql.append(" ORDER by ");
+            ordersql.append(wq);
+            ordersql.append(" DESC ");
+            return *mod;
+        }
+
+        M_MODEL &having(const std::string &wq)
+        {
+
+            groupsql.append(" HAVING by ");
+            groupsql.append(wq);
+            return *mod;
+        }
+
+        M_MODEL &group(const std::string &wq)
+        {
+
+            groupsql.append(" GROUP BY ");
+            groupsql.append(wq);
+            return *mod;
+        }
+
+        M_MODEL &orsub()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            else
+            {
+                wheresql.append(" OR (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+            return *mod;
+        }
+        M_MODEL &andsub()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao = false;
+                wheresql.append(" )");
+                ishascontent = false;
+            }
+            else
+            {
+                wheresql.append(" AND (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+
+            return *mod;
+        }
+
+        M_MODEL &endsub()
+        {
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            return *mod;
+        }
+
+        M_MODEL &or_b()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            else
+            {
+                wheresql.append(" OR (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+            return *mod;
+        }
+        M_MODEL &and_b()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao = false;
+                wheresql.append(" )");
+                ishascontent = false;
+            }
+            else
+            {
+                wheresql.append(" AND (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+
+            return *mod;
+        }
+
+        M_MODEL &or_e()
+        {
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            return *mod;
+        }
+
+        M_MODEL &and_e()
+        {
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            return *mod;
+        }
+
+        M_MODEL &limit(unsigned int num)
+        {
+            limitsql.clear();
+            limitsql.append(" limit ");
+            limitsql.append(std::to_string(num));
+            return *mod;
+        }
+        M_MODEL &limit(unsigned int num, unsigned int endnum)
+        {
+            limitsql.clear();
+            limitsql.append(" limit ");
+            limitsql.append(std::to_string(num));
+            limitsql.push_back(',');
+            limitsql.append(std::to_string(endnum));
+            return *mod;
+        }
+
+        std::vector<std::map<std::string, std::string>> fetch_obj()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            std::vector<std::map<std::string, std::string>> temprecord;
+
+            if (iserror)
+            {
+                return temprecord;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    return temprecord;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return temprecord;
+                }
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::map<std::string, std::string> data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    std::string temp_str;
+                                    temp_str.resize(name_length);
+                                    std::memcpy(temp_str.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    if (field_array[ij].name.size() > 0)
+                                    {
+                                        data_temp.insert({field_array[ij].name, std::move(temp_str)});
+                                    }
+                                    else if (field_array[ij].org_name.size() > 0)
+                                    {
+                                        data_temp.insert({field_array[ij].org_name, std::move(temp_str)});
+                                    }
+
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return temprecord;
+        }
+        std::tuple<std::vector<std::string>, std::map<std::string, unsigned int>, std::vector<std::vector<std::string>>>
+        fetch_row()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            std::vector<std::vector<std::string>> temprecord;
+            std::vector<std::string> table_fieldname;
+            std::map<std::string, unsigned int> table_fieldmap;
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+
+                model_meta_cache<std::vector<std::string>> &temp_cache =
+                    model_meta_cache<std::vector<std::string>>::getinstance();
+                temprecord = temp_cache.get(sqlhashid);
+                if (temprecord.size() > 0)
+                {
+                    iscache                                    = false;
+                    model_meta_cache<std::string> &table_cache = model_meta_cache<std::string>::getinstance();
+                    table_fieldname                            = table_cache.get(sqlhashid);
+
+                    model_meta_cache<std::map<std::string, unsigned int>> &tablemap_cache =
+                        model_meta_cache<std::map<std::string, unsigned int>>::getinstance();
+                    table_fieldmap = tablemap_cache.get_obj(sqlhashid);
+
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+            }
+
+            if (iserror)
+            {
+                return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                // std::vector<std::vector<std::string>> field_value;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                        table_fieldmap.insert({field_array[ii].org_name,table_fieldname.size()});
+                                        table_fieldname.push_back(field_array[ii].org_name);
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::vector<std::string> temp_v_record; 
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+                                    std::string tempstr;
+                                    tempstr.resize(name_length);
+                                    std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    temp_v_record.push_back(std::move(tempstr));
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.push_back(temp_v_record);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        if (temprecord.size() > 0)
+                        {
+                            std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+
+                            model_meta_cache<std::vector<std::string>> &temp_cache =
+                                model_meta_cache<std::vector<std::string>>::getinstance();
+                            temp_cache.save(sqlhashid, temprecord, exptime);
+
+                            exptime += 1;
+                            model_meta_cache<std::string> &table_cache = model_meta_cache<std::string>::getinstance();
+                            table_cache.save(sqlhashid, table_fieldname, exptime);
+
+                            model_meta_cache<std::map<std::string, unsigned int>> &tablemap_cache =
+                                model_meta_cache<std::map<std::string, unsigned int>>::getinstance();
+                            tablemap_cache.save(sqlhashid, table_fieldmap, exptime);
+                            exptime = 0;
+                            iscache = false;
+                        }
+                    }
+                }
+
+                return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord));
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+        }
+        M_MODEL &fetch()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return *mod;
+                }
+            }
+
+            B_BASE::record_reset();
+            if (iserror)
+            {
+                return *mod;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return *mod;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return *mod;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return *mod;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return *mod;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return *mod;
+        }
+
+        asio::awaitable<unsigned int> async_fetch()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 0;
+                }
+            }
+
+            B_BASE::record_reset();
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+        M_MODEL &fetch_append()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return *mod;
+                }
+            }
+
+            if (iserror)
+            {
+                return *mod;
+            }
+ 
+            try
+            {
+ 
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+                
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return *mod;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return *mod;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return *mod;
+        }
+
+        asio::awaitable<unsigned int> async_fetch_append()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 1;
+                }
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                // asio::error_code ec;
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                // std::vector<std::vector<std::string>> field_value;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+                // std::map<unsigned char, std::string> other_col;
+
+                for (; is_sql_item == false;)
+                {
+                    // std::memset(result_data, 0x00, 4096);
+                    // n      = co_await conn->socket->async_read_some(asio::buffer(result_data), asio::use_awaitable);
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                effect_num++;
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+        unsigned int fetch_one(bool isappend = false)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+
+            sqlstring.append(" limit 1");
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                if (isappend)
+                                {
+                                    typename B_BASE::meta data_temp;
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    B_BASE::record.emplace_back(std::move(data_temp));
+                                    effect_num++;
+                                }
+                                else
+                                {
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    effect_num++;
+                                }
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_fetch_one(bool isappend = false)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+
+            sqlstring.append(" limit 1");
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                // std::vector<std::vector<std::string>> field_value;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+                // std::map<unsigned char, std::string> other_col;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                if (isappend)
+                                {
+                                    typename B_BASE::meta data_temp;
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    B_BASE::record.emplace_back(std::move(data_temp));
+                                    effect_num++;
+                                }
+                                else
+                                {
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    effect_num++;
+                                }
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        M_MODEL &use_cache(int cache_time = 0)
+        {
+            iscache = true;
+            exptime = cache_time;
+            return *mod;
+        }
+        bool isuse_cache(bool iscachedate = false)
+        {
+            if (iscachedate)
+            {
+                return exptime == 0 && iscache == false;
+            }
+            return iscache;
+        }
+        void set_cache_state(bool isrestatus = false) { iscache = isrestatus; }
+        void remove_exptime_cache()
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.remove_exptime();
+        }
+        void clear_cache()
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.clear();
+        }
+        bool remove_cache()
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            std::size_t sqlhashid                               = std::hash<std::string>{}(sqlstring);
+            return temp_cache.remove(sqlhashid);
+        }
+        bool remove_cache(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            return temp_cache.remove(cache_key_name);
+        }
+        int check_cache(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            return temp_cache.check(cache_key_name);
+        }
+        std::vector<typename B_BASE::meta> get_cache_data(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            auto cache_data                                     = temp_cache.get(cache_key_name);
+            return cache_data;
+        }
+        typename B_BASE::meta get_cache_obj(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            auto cache_data                                     = temp_cache.get_obj(cache_key_name);
+            return cache_data;
+        }
+        M_MODEL &get_cache(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            B_BASE::record                                      = temp_cache.get(cache_key_name);
+            if (B_BASE::record.size() == 0)
+            {
+                B_BASE::record_reset();
+            }
+            else
+            {
+                B_BASE::data = B_BASE::record[0];
+            }
+            return *mod;
+        }
+        int update_cache(int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            std::size_t sqlhashid                               = std::hash<std::string>{}(sqlstring);
+            return temp_cache.update(sqlhashid, exp_time);
+        }
+        int update_cache(std::size_t cache_key_name, int exp_time)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            return temp_cache.update(cache_key_name, exp_time);
+        }
+        bool save_cache(int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            std::size_t sqlhashid                               = std::hash<std::string>{}(sqlstring);
+            temp_cache.save(sqlhashid, B_BASE::record, exp_time);
+            return true;
+        }
+
+        bool save_cache(std::size_t cache_key_name, typename B_BASE::meta &cache_data, int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.save(cache_key_name, cache_data, exp_time);
+            return true;
+        }
+
+        bool save_cache(std::size_t cache_key_name, std::vector<typename B_BASE::meta> &cache_data, int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.save(cache_key_name, cache_data, exp_time);
+            return true;
+        }
+        bool get_cacherecord(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            B_BASE::record                                      = temp_cache.get(cache_key_name);
+            if (B_BASE::record.size() == 0)
+            {
+                return false;
+            }
+            else
+            {
+                B_BASE::data = B_BASE::record[0];
+                return true;
+            }
+        }
+        http::OBJ_VALUE fetch_json()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            http::OBJ_VALUE valuetemp;
+            valuetemp.set_array();
+
+            if (iserror)
+            {
+                return valuetemp;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+ 
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                http::OBJ_VALUE json_temp_v;  
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    std::string temp_str;    
+                                    temp_str.resize(name_length);
+                                    std::memcpy(temp_str.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    if(field_array[ij].name.size()>0)
+                                    {
+                                        //or alias name
+                                        json_temp_v[field_array[ij].name]=std::move(temp_str);
+                                    }
+                                    else if(field_array[ij].org_name.size()>0)
+                                    {
+                                        json_temp_v[field_array[ij].org_name]=std::move(temp_str);
+                                    }
+                                    tempnum = tempnum + name_length;
+                                }
+                                valuetemp.push(json_temp_v);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return valuetemp;
+        }
+
+        asio::awaitable<http::OBJ_VALUE> async_fetch_json()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            http::OBJ_VALUE valuetemp;
+            valuetemp.set_array();
+
+            if (iserror)
+            {
+                co_return valuetemp;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return valuetemp;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+ 
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                http::OBJ_VALUE json_temp_v;  
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    std::string temp_str;    
+                                    temp_str.resize(name_length);
+                                    std::memcpy(temp_str.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    if(field_array[ij].name.size()>0)
+                                    {
+                                        //or alias name
+                                        json_temp_v[field_array[ij].name]=std::move(temp_str);
+                                    }
+                                    else if(field_array[ij].org_name.size()>0)
+                                    {
+                                        json_temp_v[field_array[ij].org_name]=std::move(temp_str);
+                                    }
+                                    tempnum = tempnum + name_length;
+                                }
+                                valuetemp.push(json_temp_v);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return valuetemp;
+        }
+
+        long long get_one(long long id)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+            sqlstring.append(" limit 1");
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                    tempnum = tempnum + name_length;
+                                }
+                                 
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);               
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_get_one(long long id)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+            sqlstring.append(" limit 1");
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                    tempnum = tempnum + name_length;
+                                }
+                                 
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);               
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        int update()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            sqlstring = B_BASE::_makeupdatesql("");
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        int update(const std::string &fieldname)
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    error_msg = "warning empty where sql!";
+                    return 0;
+                }
+            }
+
+            sqlstring = B_BASE::_makeupdatesql(fieldname);
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        asio::awaitable<int> async_update(const std::string &fieldname)
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    error_msg = "warning empty where sql!";
+                    co_return 0;
+                }
+            }
+
+            sqlstring = B_BASE::_makeupdatesql(fieldname);
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                co_return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+            try
+            {
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                    iserror = true;
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+
+            }
+            co_return 0;
+        }
+        asio::awaitable<int> async_update()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    error_msg = "warning empty where sql!";
+                    co_return 0;
+                }
+            }
+
+            sqlstring = B_BASE::_makeupdatesql("");
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                co_return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+            try
+            {
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                    iserror = true;
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+
+            }
+            co_return 0;
+        }
+
+        int update_batch(const std::string &fieldname)
+        {
+            effect_num = 0;
+            if (B_BASE::record.size() == 0)
+            {
+                return 0;
+            }
+            if (fieldname.size() > 0)
+            {
+                sqlstring = B_BASE::_make_insert_into_sql(fieldname);
+            }
+            else
+            {
+                sqlstring = B_BASE::_make_replace_into_sql();
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        int remove()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+
+            sqlstring = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_remove()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    co_return 0;
+                }
+            }
+
+            sqlstring = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                co_return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            co_return 0;
+        }
+
+        int remove(long long id)
+        {
+            effect_num = 0;
+            sqlstring  = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_remove(long long id)
+        {
+            effect_num = 0;
+            sqlstring  = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            co_return 0;
+        }
+
+        int soft_remove(const std::string &fieldsql)
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+
+            sqlstring = B_BASE::soft_remove_sql(fieldsql);
+            if (sqlstring.empty())
+            {
+                error_msg = "soft delete field empty.";
+                return 0;
+            }
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        int soft_remove()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    effect_num = 1;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            if (effect_num == 1)
+            {
+                sqlstring = B_BASE::soft_remove_sql(" ");
+            }
+            else
+            {
+                sqlstring = B_BASE::soft_remove_sql("");
+            }
+            effect_num = 0;
+            if (sqlstring.empty())
+            {
+                error_msg = "soft delete field empty.";
+                return 0;
+            }
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        long long insert(typename B_BASE::meta &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_insert(typename B_BASE::meta &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    co_return insert_last_id;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        long long insert(std::vector<typename B_BASE::meta> &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_insert(std::vector<typename B_BASE::meta> &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    co_return insert_last_id;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        long long insert()
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makeinsertsql();
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_insert()
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makeinsertsql();
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    co_return insert_last_id;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+
+        long long save(bool isrealnew = false)
+        {
+            effect_num = 0;
+            if (B_BASE::getPK() > 0 && isrealnew == false)
+            {
+                if (wheresql.empty())
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                sqlstring = B_BASE::_makeupdatesql("");
+                sqlstring.append(" where ");
+                if (wheresql.empty())
+                {
+                    return 0;
+                }
+                else
+                {
+                    sqlstring.append(wheresql);
+                }
+                if (!groupsql.empty())
+                {
+                    sqlstring.append(groupsql);
+                }
+                if (!ordersql.empty())
+                {
+                    sqlstring.append(ordersql);
+                }
+                if (!limitsql.empty())
+                {
+                    sqlstring.append(limitsql);
+                }
+                if (iscommit)
+                {
+                    iscommit = false;
+                    return 0;
+                }
+
+                if (iserror)
+                {
+                    return 0;
+                }
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            else
+            {
+                sqlstring  = B_BASE::_makeinsertsql();
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_save(bool isrealnew = false)
+        {
+            effect_num = 0;
+            if (B_BASE::getPK() > 0 && isrealnew == false)
+            {
+                if (wheresql.empty())
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                sqlstring = B_BASE::_makeupdatesql("");
+                sqlstring.append(" where ");
+                if (wheresql.empty())
+                {
+                    co_return 0;
+                }
+                else
+                {
+                    sqlstring.append(wheresql);
+                }
+                if (!groupsql.empty())
+                {
+                    sqlstring.append(groupsql);
+                }
+                if (!ordersql.empty())
+                {
+                    sqlstring.append(ordersql);
+                }
+                if (!limitsql.empty())
+                {
+                    sqlstring.append(limitsql);
+                }
+                if (iscommit)
+                {
+                    iscommit = false;
+                    co_return 0;
+                }
+
+                if (iserror)
+                {
+                    co_return 0;
+                }
+
+                try
+                {
+                    if (conn_empty())
+                    {
+                        co_return 0;
+                    }
+                    auto conn = co_await conn_obj->async_get_edit_conn();
+
+                    unsigned int querysql_len = sqlstring.length() + 1;
+
+                    conn->send_data.clear();
+                    conn->send_data.push_back((querysql_len & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                    conn->send_data.push_back(0x00);
+                    conn->send_data.push_back(0x03);
+                    conn->send_data.append(sqlstring);
+
+                    std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                    unsigned int offset = 0;
+                    n                   = co_await conn->async_read_loop();
+
+                    pack_info_t temp_pack_data;
+                    temp_pack_data.seq_id = 1;
+                    conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                    conn_obj->back_edit_conn(conn);
+
+                    if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                    {
+                        error_msg = temp_pack_data.data.substr(3);
+                        iserror = true;
+                    }
+                    else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                    {
+
+                        unsigned int d_offset = 1;
+                        effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+
+                        co_return effect_num;
+                    }
+                    co_return 0;
+                }
+                catch (const std::exception &e)
+                {
+                    error_msg = std::string(e.what());
+                    co_return 0;
+                }
+                catch (const std::string &e)
+                {
+                    error_msg = e;
+                }
+                catch (...)
+                {
+                    co_return 0;
+                }
+                co_return 0;
+            }
+            else
+            {
+                sqlstring  = B_BASE::_makeinsertsql();
+                try
+                {
+                    if (conn_empty())
+                    {
+                        co_return 0;
+                    }
+                    auto conn = co_await conn_obj->async_get_edit_conn();
+
+                    unsigned int querysql_len = sqlstring.length() + 1;
+
+                    conn->send_data.clear();
+                    conn->send_data.push_back((querysql_len & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                    conn->send_data.push_back(0x00);
+                    conn->send_data.push_back(0x03);
+                    conn->send_data.append(sqlstring);
+
+                    std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                    
+                    unsigned int offset = 0;
+                    n                   = co_await conn->async_read_loop();
+
+                    pack_info_t temp_pack_data;
+                    temp_pack_data.seq_id = 1;
+                    conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                    conn_obj->back_edit_conn(conn);
+
+                    if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                    {
+                        error_msg = temp_pack_data.data.substr(3);
+                    }
+                    else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                    {
+
+                        unsigned int d_offset = 1;
+                        effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                        long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                        co_return insert_last_id;
+                    }
+                    co_return 0;
+                }
+                catch (const std::exception &e)
+                {
+                    error_msg = std::string(e.what());
+                }
+                catch (const std::string &e)
+                {
+                    error_msg = e;
+                }
+                catch (...)
+                {
+                }
+                co_return 0;
+            }
+            co_return 0;
+        }
+
+        std::tuple<std::vector<std::string>, std::map<std::string, unsigned int>, std::vector<std::vector<std::string>>>
+        query(const std::string &rawsql)
+        {
+
+            std::vector<std::vector<std::string>> temprecord;
+            std::vector<std::string> table_fieldname;
+            std::map<std::string, unsigned int> table_fieldmap;
+
+            if(rawsql.size()>10)
+            {
+                unsigned int i=0;
+                for(;i<rawsql.size();i++)
+                {
+                    if(rawsql[i]!=0x20)
+                    {
+                        break;
+                    }
+                }
+                if(i<5)
+                {
+                    //must be select
+                    if(rawsql[i]!='s' && rawsql[i]!='S')
+                    {
+                        iserror = true;   
+                    }
+                }
+                else
+                {
+                    iserror = true;   
+                }
+            }
+            else
+            {
+                iserror = true;   
+            }
+
+            if (iserror)
+            {
+                return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = rawsql.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(rawsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                        table_fieldmap.insert({field_array[ii].org_name,table_fieldname.size()});
+                                        table_fieldname.push_back(field_array[ii].org_name);
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::vector<std::string> temp_v_record; 
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+                                    std::string tempstr;
+                                    tempstr.resize(name_length);
+                                    std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    temp_v_record.push_back(std::move(tempstr));
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.push_back(temp_v_record);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord));
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+        }
+
+        asio::awaitable<std::tuple<std::vector<std::string>, std::map<std::string, unsigned int>, std::vector<std::vector<std::string>>>>
+        async_query(const std::string &rawsql)
+        {
+
+            std::vector<std::vector<std::string>> temprecord;
+            std::vector<std::string> table_fieldname;
+            std::map<std::string, unsigned int> table_fieldmap;
+
+            if(rawsql.size()>10)
+            {
+                unsigned int i=0;
+                for(;i<rawsql.size();i++)
+                {
+                    if(rawsql[i]!=0x20)
+                    {
+                        break;
+                    }
+                }
+                if(i<5)
+                {
+                    //must be select
+                    if(rawsql[i]!='s' && rawsql[i]!='S')
+                    {
+                        iserror = true;   
+                    }
+                }
+                else
+                {
+                    iserror = true;   
+                }
+            }
+            else
+            {
+                iserror = true;   
+            }
+
+            if (iserror)
+            {
+                co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = rawsql.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(rawsql);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                        table_fieldmap.insert({field_array[ii].org_name,table_fieldname.size()});
+                                        table_fieldname.push_back(field_array[ii].org_name);
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::vector<std::string> temp_v_record; 
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+                                    std::string tempstr;
+                                    tempstr.resize(name_length);
+                                    std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    temp_v_record.push_back(std::move(tempstr));
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.push_back(temp_v_record);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                co_return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord));
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+        }
+
+        // long long edit_query(const std::string &rawsql, bool isinsert = false)
+        // {
+        //     if (iserror)
+        //     {
+        //         return 0;
+        //     }
+
+        //     return 0;
+        // }
+        M_MODEL &clear(bool both = true)
+        {
+            selectsql.clear();
+            wheresql.clear();
+            ordersql.clear();
+            groupsql.clear();
+            limitsql.clear();
+            sqlstring.clear();
+            error_msg.clear();
+            iskuohao     = false;
+            ishascontent = false;
+            iscommit     = false;
+            iscache      = false;
+            effect_num   = 0;
+            if (both)
+            {
+                B_BASE::record_reset();
+                B_BASE::data_reset();
+            }
+            return *mod;
+        }
+        M_MODEL &clearWhere()
+        {
+            selectsql.clear();
+            wheresql.clear();
+            ordersql.clear();
+            groupsql.clear();
+            limitsql.clear();
+            sqlstring.clear();
+            error_msg.clear();
+            iskuohao     = false;
+            ishascontent = false;
+            iscommit     = false;
+            iscache      = false;
+            effect_num   = 0;
+            return *mod;
+        }
+        M_MODEL &set_data(typename B_BASE::meta indata)
+        {
+            B_BASE::data = indata;
+            return *mod;
+        }
+        M_MODEL &get() { return *mod; }
+        std::string get_query() { return sqlstring; }
+        M_MODEL &start_commit()
+        {
+            iscommit = true;
+            return *mod;
+        }
+        M_MODEL &end_commit()
+        {
+            iscommit = false;
+            return *mod;
+        }
+
+        unsigned int effect()
+        {
+            return effect_num;
+        }
+        bool conn_empty()
+        {
+            if (conn_obj)
+            {
+                return false; 
+            }
+            error_msg = "conn_obj is null";
+            iserror   = true;
+            return true;
+        }
+
+      public:
+        std::string selectsql;
+        std::string wheresql;
+        std::string ordersql;
+        std::string groupsql;
+        std::string limitsql;
+        std::string sqlstring;
+        std::string dbtag;
+        std::string error_msg;
+        std::string original_tablename;
+
+        // std::list<std::string> commit_sqllist;
+        bool iskuohao           = false;
+        bool iscommit           = false;
+        bool ishascontent       = false;
+        bool iscache            = false;
+        bool iserror            = false;
+        int exptime             = 0;
+        unsigned int effect_num = 0;
+
+        M_MODEL *mod;
+
+        std::shared_ptr<orm_conn_pool> conn_obj;
+    };
+//} /*tagnamespace_replace*/
+}// namespace orm
+#endif

+ 269 - 330
frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortunebase.h

@@ -2,7 +2,7 @@
 #define ORM_DEFAULT_FORTUNEBASEMATA_H
 #define ORM_DEFAULT_FORTUNEBASEMATA_H
 /*
 /*
 *This file is auto create from cli
 *This file is auto create from cli
-*本文件为自动生成 Fri, 26 Jan 2024 02:59:30 GMT
+*本文件为自动生成 Sun, 02 Mar 2025 10:54:30 GMT
 ***/
 ***/
 #include <iostream>
 #include <iostream>
 #include <cstdio>
 #include <cstdio>
@@ -14,28 +14,30 @@
 #include <vector>
 #include <vector>
 #include <ctime>
 #include <ctime>
 #include <array>
 #include <array>
-#include "mysql.h"
+#include "unicode.h"
+
 namespace orm { 
 namespace orm { 
    
    
     
     
 struct fortunebase
 struct fortunebase
 {
 {
     struct meta{
     struct meta{
-    unsigned  int id= 0; //
- std::string message=""; //
+     unsigned  int  id = 0; ///**/
+ std::string  message = ""; ///**/
  } data;
  } data;
  std::vector<fortunebase::meta> record;
  std::vector<fortunebase::meta> record;
 std::string _rmstag="default";//this value must be default or tag value, tag in mysqlconnect config file .
 std::string _rmstag="default";//this value must be default or tag value, tag in mysqlconnect config file .
-std::vector<unsigned char> _keypos{0x00};
-MYSQL_ROW _row;
+unsigned int _offset=0;
 std::vector<fortunebase::meta>::iterator begin(){     return record.begin(); }
 std::vector<fortunebase::meta>::iterator begin(){     return record.begin(); }
 std::vector<fortunebase::meta>::iterator end(){     return record.end(); }
 std::vector<fortunebase::meta>::iterator end(){     return record.end(); }
 std::vector<fortunebase::meta>::const_iterator begin() const{     return record.begin(); }
 std::vector<fortunebase::meta>::const_iterator begin() const{     return record.begin(); }
 std::vector<fortunebase::meta>::const_iterator end() const{     return record.end(); }
 std::vector<fortunebase::meta>::const_iterator end() const{     return record.end(); }
-const std::array<std::string,2> colnames={"id","message"};
-const std::array<unsigned char,2> colnamestype= {3,253};
+static constexpr std::array<std::string_view,2> col_names={"id","message"};
+static constexpr std::array<unsigned char,2> col_types={3,253};
+static constexpr std::array<unsigned char,2> col_length={0,0};
+static constexpr std::array<unsigned char,2> col_decimals={0,0};
 std::string tablename="fortune";
 std::string tablename="fortune";
-std::string modelname="Fortune";
+static constexpr std::string_view modelname="Fortune";
 
 
 	  unsigned char findcolpos(const std::string &coln){
 	  unsigned char findcolpos(const std::string &coln){
             if(coln.size()==0)
             if(coln.size()==0)
@@ -82,70 +84,9 @@ break;
      
      
          return temp;
          return temp;
      }
      }
-     void _setColnamevalue()
-      {
-        for(unsigned char i=0;i<_keypos.size();i++)
-        {
-            switch(_keypos[i]){
-        	case 0:
-		 try{
-			data.id=std::stoul(_row[i]);
-		}catch (...) { 
-			data.id=0;
-			 }
-			break;
-	case 1:
-		 try{
-			data.message.append((_row[i]==NULL?"":_row[i]));
-		}catch (...) { 
-			data.message.clear();
-			 }
-			break;
-	default:
-		 { }
-			
-
-                 }
-
-                 if(i>210){
-                     break;
-                 }
-          }
-   } 
-         void _addnewrowvalue(){
-           fortunebase::meta metatemp;   
-
-          for(unsigned char i=0;i<_keypos.size();i++){
- 
-                 switch(_keypos[i]){
-
-        	case 0:
-		 try{
-			metatemp.id=std::stoul(_row[i]);
-		}catch (...) { 
-			metatemp.id=0;
-			 }
-			break;
-	case 1:
-		 try{
-			metatemp.message.append((_row[i]==NULL?"":_row[i]));
-		}catch (...) { 
-			metatemp.message.clear();
-			 }
-			break;
-	default:
-		 { }
-			
-
-                  }
-                 if(i>210){
-                     break;
-                 }
-          }
-           record.emplace_back(std::move(metatemp)); 
-   } 
+     
 
 
-  inline  std::string stringaddslash(std::string &content){
+  inline  std::string stringaddslash(const std::string &content){
         std::string temp;
         std::string temp;
         for(unsigned int i=0;i<content.size();i++){
         for(unsigned int i=0;i<content.size();i++){
             if(content[i]=='\''){
             if(content[i]=='\''){
@@ -162,7 +103,7 @@ break;
         }
         }
         return temp;
         return temp;
    }  
    }  
-  inline  std::string jsonaddslash(std::string &content){
+  inline  std::string jsonaddslash(const std::string &content){
         std::string temp;
         std::string temp;
         for(unsigned int i=0;i<content.size();i++){
         for(unsigned int i=0;i<content.size();i++){
             if(content[i]=='"'){
             if(content[i]=='"'){
@@ -179,23 +120,23 @@ break;
    }  
    }  
 
 
    std::string _makeinsertsql(){
    std::string _makeinsertsql(){
-      unsigned int j=0;
-                std::ostringstream tempsql;
-                tempsql<<"INSERT INTO ";
-                    tempsql<<tablename;
-                   tempsql<<" (";
-                    for(;j<colnames.size();j++){
-                            if(j>0){
-                                tempsql<<"`,`";
-                            }else{
-                                tempsql<<"`";
-                            }
-                            tempsql<<colnames[j];
-                    }
-                    if(j>0){
-                        tempsql<<"`";
-                    }
-            tempsql<<") VALUES (";
+        unsigned int j=0;
+        std::ostringstream tempsql;
+        tempsql<<"INSERT INTO ";
+        tempsql<<tablename;
+        tempsql<<" (";
+        for(;j<col_names.size();j++){
+                if(j>0){
+                    tempsql<<"`,`";
+                }else{
+                    tempsql<<"`";
+                }
+                tempsql<<col_names[j];
+        }
+        if(j>0){
+            tempsql<<"`";
+        }
+        tempsql<<") VALUES (";
 
 
         if(data.id==0){
         if(data.id==0){
 tempsql<<"null";
 tempsql<<"null";
@@ -209,24 +150,24 @@ tempsql<<")";
        return tempsql.str();
        return tempsql.str();
    } 
    } 
       
       
-      std::string _makerecordinsertsql( meta &insert_data){
-      unsigned int j=0;
-                std::ostringstream tempsql;
-                tempsql<<"INSERT INTO ";
-                    tempsql<<tablename;
-                   tempsql<<" (";
-                    for(;j<colnames.size();j++){
-                            if(j>0){
-                                tempsql<<"`,`";
-                            }else{
-                                tempsql<<"`";
-                            }
-                            tempsql<<colnames[j];
-                    }
-                    if(j>0){
-                        tempsql<<"`";
-                    }
-            tempsql<<") VALUES (";
+      std::string _makerecordinsertsql(const meta &insert_data){
+        unsigned int j=0;
+        std::ostringstream tempsql;
+        tempsql<<"INSERT INTO ";
+        tempsql<<tablename;
+        tempsql<<" (";
+        for(;j<col_names.size();j++){
+                if(j>0){
+                    tempsql<<"`,`";
+                }else{
+                    tempsql<<"`";
+                }
+                tempsql<<col_names[j];
+        }
+        if(j>0){
+            tempsql<<"`";
+        }
+        tempsql<<") VALUES (";
 
 
         if(insert_data.id==0){
         if(insert_data.id==0){
 tempsql<<"null";
 tempsql<<"null";
@@ -240,35 +181,35 @@ tempsql<<")";
        return tempsql.str();
        return tempsql.str();
    } 
    } 
        
        
-      std::string _makerecordinsertsql( std::vector<meta> &insert_data){
-      unsigned int j=0;
-                std::ostringstream tempsql;
-                tempsql<<"INSERT INTO ";
-                    tempsql<<tablename;
-                   tempsql<<" (";
-                    for(;j<colnames.size();j++){
-                            if(j>0){
-                                tempsql<<"`,`";
-                            }else{
-                                tempsql<<"`";
-                            }
-                            tempsql<<colnames[j];
-                    }
-                    if(j>0){
-                        tempsql<<"`";
-                    }
-            tempsql<<") VALUES ";
+    std::string _makerecordinsertsql(const std::vector<meta> &insert_data){
+        unsigned int j=0;
+        std::ostringstream tempsql;
+        tempsql<<"INSERT INTO ";
+        tempsql<<tablename;
+        tempsql<<" (";
+        for(;j<col_names.size();j++){
+                if(j>0){
+                    tempsql<<"`,`";
+                }else{
+                    tempsql<<"`";
+                }
+                tempsql<<col_names[j];
+        }
+        if(j>0){
+            tempsql<<"`";
+        }
+        tempsql<<") VALUES ";
 
 
-    for(unsigned int i=0;i<insert_data.size();i++)
-    {
-		if(i>0)
-		{
-			tempsql<<",";	
-		}
-		tempsql<<"(";
+        for(unsigned int i=0;i<insert_data.size();i++)
+        {
+            if(i>0)
+            {
+                tempsql<<",";	
+            }
+            tempsql<<"(";
 
 
 
 
-        	if(insert_data[i].id==0){
+            	if(insert_data[i].id==0){
 	tempsql<<"null";
 	tempsql<<"null";
 	 }else{ 
 	 }else{ 
 	tempsql<<std::to_string(insert_data[i].id);
 	tempsql<<std::to_string(insert_data[i].id);
@@ -282,17 +223,16 @@ tempsql<<")";
    } 
    } 
        
        
     std::string _makeupdatesql(const std::string &fileld){
     std::string _makeupdatesql(const std::string &fileld){
-       //int j=0;
-            std::ostringstream tempsql;
-                 tempsql<<"UPDATE ";
-                 tempsql<<tablename;
-                 tempsql<<" SET ";
-
-            bool isall=false;
-            if(fileld.empty()){
-                isall=true;
-            }
-            if(isall){
+        std::ostringstream tempsql;
+        tempsql<<"UPDATE ";
+        tempsql<<tablename;
+        tempsql<<" SET ";
+
+        bool isall=false;
+        if(fileld.empty()){
+            isall=true;
+        }
+        if(isall){
 
 
         if(data.id==0){
         if(data.id==0){
 	tempsql<<"`id`=0";
 	tempsql<<"`id`=0";
@@ -311,7 +251,7 @@ tempsql<<",`message`='"<<stringaddslash(data.message)<<"'";
                                 unsigned char bpos_i=findcolpos(keyname);
                                 unsigned char bpos_i=findcolpos(keyname);
                                keypos.emplace_back(bpos_i); 
                                keypos.emplace_back(bpos_i); 
 #ifdef DEBUG
 #ifdef DEBUG
-                    if (bpos_i == 254)
+                    if (bpos_i == 255)
                     {
                     {
                         std::cout << "\033[1m\033[31m-----------\n"
                         std::cout << "\033[1m\033[31m-----------\n"
                                   << keyname << " not in " << tablename << " table Field.\n-----------\033[0m"
                                   << keyname << " not in " << tablename << " table Field.\n-----------\033[0m"
@@ -331,7 +271,7 @@ tempsql<<",`message`='"<<stringaddslash(data.message)<<"'";
                  if(keyname.size()>0){
                  if(keyname.size()>0){
                                 unsigned char bpos_i=findcolpos(keyname);
                                 unsigned char bpos_i=findcolpos(keyname);
  #ifdef DEBUG
  #ifdef DEBUG
-                    if (bpos_i == 254)
+                    if (bpos_i == 255)
                     {
                     {
                         std::cout << "\033[1m\033[31m-----------\n"
                         std::cout << "\033[1m\033[31m-----------\n"
                                   << keyname << " not in " << tablename << " table Field.\n-----------\033[0m"
                                   << keyname << " not in " << tablename << " table Field.\n-----------\033[0m"
@@ -375,7 +315,7 @@ tempsql<<"`message`='"<<stringaddslash(data.message)<<"'";
         tempsql << "REPLACE INTO ";
         tempsql << "REPLACE INTO ";
         tempsql << tablename;
         tempsql << tablename;
         tempsql << " (";
         tempsql << " (";
-        for (; j < colnames.size(); j++)
+        for (; j < col_names.size(); j++)
         {
         {
             if (j > 0)
             if (j > 0)
             {
             {
@@ -385,7 +325,7 @@ tempsql<<"`message`='"<<stringaddslash(data.message)<<"'";
             {
             {
                 tempsql << "`";
                 tempsql << "`";
             }
             }
-            tempsql << colnames[j];
+            tempsql << col_names[j];
         }
         }
         if (j > 0)
         if (j > 0)
         {
         {
@@ -419,7 +359,7 @@ tempsql<<"`message`='"<<stringaddslash(data.message)<<"'";
         tempsql << "INSERT INTO ";
         tempsql << "INSERT INTO ";
         tempsql << tablename;
         tempsql << tablename;
         tempsql << " (";
         tempsql << " (";
-        for (; j < colnames.size(); j++)
+        for (; j < col_names.size(); j++)
         {
         {
             if (j > 0)
             if (j > 0)
             {
             {
@@ -429,7 +369,7 @@ tempsql<<"`message`='"<<stringaddslash(data.message)<<"'";
             {
             {
                 tempsql << "`";
                 tempsql << "`";
             }
             }
-            tempsql << colnames[j];
+            tempsql << col_names[j];
         }
         }
         if (j > 0)
         if (j > 0)
         {
         {
@@ -455,33 +395,12 @@ tempsql<<"`message`='"<<stringaddslash(data.message)<<"'";
 	 tempsql<<" as new ON DUPLICATE KEY UPDATE ";
 	 tempsql<<" as new ON DUPLICATE KEY UPDATE ";
 
 
      
      
-    std::string keyname;
-    unsigned char jj=0;
-    j=0;
-     if(fileld.size()>0){
-            for(;jj<fileld.size();jj++){
-                    if(fileld[jj]==','){
-                        if(findcolpos(keyname)<255)
-                        {
-                            if(j>0)
-                            {
-                                tempsql<<",";
-                            }
-                            tempsql<<keyname;
-                            tempsql<<"=new.";
-                            tempsql<<keyname;
-                             
-                        }
-                        continue;   
-                    }
-                    if(fileld[jj]==0x20){
-
-                        continue;   
-                    }
-                    keyname.push_back(fileld[jj]);
-
-            }  
-            if(keyname.size()>0){
+        std::string keyname;
+        unsigned char jj=0;
+        j=0;
+        if(fileld.size()>0){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
                 if(findcolpos(keyname)<255)
                 if(findcolpos(keyname)<255)
                 {
                 {
                     if(j>0)
                     if(j>0)
@@ -491,10 +410,30 @@ tempsql<<"`message`='"<<stringaddslash(data.message)<<"'";
                     tempsql<<keyname;
                     tempsql<<keyname;
                     tempsql<<"=new.";
                     tempsql<<"=new.";
                     tempsql<<keyname;
                     tempsql<<keyname;
-                    
                 }
                 }
+                continue;   
             }
             }
-        } 
+            if(fileld[jj]==0x20){
+                continue;   
+            }
+            keyname.push_back(fileld[jj]);
+
+        }  
+        if(keyname.size()>0){
+            if(findcolpos(keyname)<255)
+            {
+                if(j>0)
+                {
+                    tempsql<<",";
+                }
+                tempsql<<keyname;
+                tempsql<<"=new.";
+                tempsql<<keyname;
+                
+            }
+        }
+
+    } 
  
  
  return tempsql.str();
  return tempsql.str();
 }
 }
@@ -506,30 +445,30 @@ tempsql<<"`message`='"<<stringaddslash(data.message)<<"'";
         std::vector<unsigned char> keypos;
         std::vector<unsigned char> keypos;
         if(fileld.size()>1){
         if(fileld.size()>1){
             for(;jj<fileld.size();jj++){
             for(;jj<fileld.size();jj++){
-                    if(fileld[jj]==','){
-                        keypos.emplace_back(findcolpos(keyname)); 
-                        keyname.clear();
-                        continue;   
-                    }
-                    if(fileld[jj]==0x20){
+                if(fileld[jj]==','){
+                    keypos.emplace_back(findcolpos(keyname)); 
+                    keyname.clear();
+                    continue;   
+                }
+                if(fileld[jj]==0x20){
 
 
-                        continue;   
-                    }
-                    keyname.push_back(fileld[jj]);
+                    continue;   
+                }
+                keyname.push_back(fileld[jj]);
 
 
             }  
             }  
             if(keyname.size()>0){
             if(keyname.size()>0){
-                            keypos.emplace_back(findcolpos(keyname)); 
-                            keyname.clear();
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
             }
             }
         }else{
         }else{
-            for(jj=0;jj<colnames.size();jj++){
+            for(jj=0;jj<col_names.size();jj++){
                 keypos.emplace_back(jj); 
                 keypos.emplace_back(jj); 
             }
             }
         }
         }
                
                
-                 for(jj=0;jj<keypos.size();jj++){
-                       switch(keypos[jj]){
+            for(jj=0;jj<keypos.size();jj++){
+                switch(keypos[jj]){
          case 0:
          case 0:
 if(data.id==0){
 if(data.id==0){
 	temparray.push_back("0");
 	temparray.push_back("0");
@@ -551,35 +490,35 @@ if(data.id==0){
    
    
    std::map<std::string,std::string> data_tomap(std::string fileld=""){
    std::map<std::string,std::string> data_tomap(std::string fileld=""){
        std::map<std::string,std::string> tempsql;
        std::map<std::string,std::string> tempsql;
-            std::string keyname;
-            unsigned char jj=0;
-                  std::vector<unsigned char> keypos;
-                  if(fileld.size()>1){
-                    for(;jj<fileld.size();jj++){
-                            if(fileld[jj]==','){
-                                keypos.emplace_back(findcolpos(keyname)); 
-                                keyname.clear();
-                                continue;   
-                            }
-                            if(fileld[jj]==0x20){
+        std::string keyname;
+        unsigned char jj=0;
+        std::vector<unsigned char> keypos;
+        if(fileld.size()>1){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
+                continue;   
+            }
+            if(fileld[jj]==0x20){
 
 
-                                continue;   
-                            }
-                            keyname.push_back(fileld[jj]);
+                continue;   
+            }
+            keyname.push_back(fileld[jj]);
 
 
-                    }  
-                    if(keyname.size()>0){
-                                    keypos.emplace_back(findcolpos(keyname)); 
-                                    keyname.clear();
-                    }
-                 }else{
-                     for(jj=0;jj<colnames.size();jj++){
-                         keypos.emplace_back(jj); 
-                     }
-                 }
-                
-                 for(jj=0;jj<keypos.size();jj++){
-                       switch(keypos[jj]){
+        }  
+        if(keyname.size()>0){
+            keypos.emplace_back(findcolpos(keyname)); 
+            keyname.clear();
+        }
+        }else{
+            for(jj=0;jj<col_names.size();jj++){
+                keypos.emplace_back(jj); 
+            }
+        }
+    
+        for(jj=0;jj<keypos.size();jj++){
+            switch(keypos[jj]){
          case 0:
          case 0:
 if(data.id==0){
 if(data.id==0){
 	tempsql.insert({"id","0"});
 	tempsql.insert({"id","0"});
@@ -617,36 +556,36 @@ tempsql<<"}";
    }   
    }   
    
    
    std::string data_tojson(std::string fileld){
    std::string data_tojson(std::string fileld){
-       std::ostringstream tempsql;
-            std::string keyname;
-            unsigned char jj=0;
-                  std::vector<unsigned char> keypos;
-                  if(fileld.size()>0){
-                    for(;jj<fileld.size();jj++){
-                            if(fileld[jj]==','){
-                                keypos.emplace_back(findcolpos(keyname)); 
-                                keyname.clear();
-                                continue;   
-                            }
-                            if(fileld[jj]==0x20){
+        std::ostringstream tempsql;
+        std::string keyname;
+        unsigned char jj=0;
+        std::vector<unsigned char> keypos;
+        if(fileld.size()>0){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
+                continue;   
+            }
+            if(fileld[jj]==0x20){
 
 
-                                continue;   
-                            }
-                            keyname.push_back(fileld[jj]);
+                continue;   
+            }
+            keyname.push_back(fileld[jj]);
 
 
-                    }  
-                    if(keyname.size()>0){
-                                    keypos.emplace_back(findcolpos(keyname)); 
-                                    keyname.clear();
-                    }
-                 }else{
-                     for(jj=0;jj<colnames.size();jj++){
-                         keypos.emplace_back(jj); 
-                     }
-                 }
-                 tempsql<<"{";
-                 for(jj=0;jj<keypos.size();jj++){
-                       switch(keypos[jj]){
+        }  
+        if(keyname.size()>0){
+            keypos.emplace_back(findcolpos(keyname)); 
+            keyname.clear();
+        }
+        }else{
+            for(jj=0;jj<col_names.size();jj++){
+                keypos.emplace_back(jj); 
+            }
+        }
+        tempsql<<"{";
+        for(jj=0;jj<keypos.size();jj++){
+            switch(keypos[jj]){
          case 0:
          case 0:
  if(jj>0){ tempsql<<","; } 
  if(jj>0){ tempsql<<","; } 
 if(data.id==0){
 if(data.id==0){
@@ -981,43 +920,43 @@ tempsql<<"\"message\":\""<<http::utf8_to_jsonstring(data.message)<<"\"";
    } 
    } 
     
     
    std::string to_json(std::string fileld=""){
    std::string to_json(std::string fileld=""){
-       std::ostringstream tempsql;
-            std::string keyname;
-            unsigned char jj=0;
-                  std::vector<unsigned char> keypos;
-                  if(fileld.size()>0){
-                    for(;jj<fileld.size();jj++){
-                            if(fileld[jj]==','){
-                                keypos.emplace_back(findcolpos(keyname)); 
-                                keyname.clear();
-                                continue;   
-                            }
-                            if(fileld[jj]==0x20){
+    std::ostringstream tempsql;
+    std::string keyname;
+    unsigned char jj=0;
+    std::vector<unsigned char> keypos;
+    if(fileld.size()>0){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
+                continue;   
+            }
+            if(fileld[jj]==0x20){
 
 
-                                continue;   
-                            }
-                            keyname.push_back(fileld[jj]);
+                continue;   
+            }
+            keyname.push_back(fileld[jj]);
 
 
-                    }  
-                    if(keyname.size()>0){
-                                    keypos.emplace_back(findcolpos(keyname)); 
-                                    keyname.clear();
-                    }
-                 }else{
-                     for(jj=0;jj<colnames.size();jj++){
-                         keypos.emplace_back(jj); 
-                     }
-                 }
-                tempsql<<"[";
-              for(size_t n=0;n<record.size();n++){
-                  if(n>0){
-                      tempsql<<",{";
-                  }else{
-                      tempsql<<"{";
-                  }  
-                 
-                 for(jj=0;jj<keypos.size();jj++){
-                       switch(keypos[jj]){
+        }  
+        if(keyname.size()>0){
+            keypos.emplace_back(findcolpos(keyname)); 
+            keyname.clear();
+        }
+    }else{
+        for(jj=0;jj<col_names.size();jj++){
+            keypos.emplace_back(jj); 
+        }
+    }
+    tempsql<<"[";
+    for(size_t n=0;n<record.size();n++){
+        if(n>0){
+            tempsql<<",{";
+        }else{
+            tempsql<<"{";
+        }  
+    
+        for(jj=0;jj<keypos.size();jj++){
+            switch(keypos[jj]){
          case 0:
          case 0:
  if(jj>0){ tempsql<<","; } 
  if(jj>0){ tempsql<<","; } 
 if(record[n].id==0){
 if(record[n].id==0){
@@ -1043,49 +982,49 @@ tempsql<<"\"message\":\""<<http::utf8_to_jsonstring(record[n].message)<<"\"";
    
    
    std::string to_json(std::function<bool(std::string&,meta&)> func,std::string fileld=""){
    std::string to_json(std::function<bool(std::string&,meta&)> func,std::string fileld=""){
        std::ostringstream tempsql;
        std::ostringstream tempsql;
-            std::string keyname;
-            unsigned char jj=0;
-                  std::vector<unsigned char> keypos;
-                  if(fileld.size()>0){
-                    for(;jj<fileld.size();jj++){
-                            if(fileld[jj]==','){
-                                keypos.emplace_back(findcolpos(keyname)); 
-                                keyname.clear();
-                                continue;   
-                            }
-                            if(fileld[jj]==0x20){
+        std::string keyname;
+        unsigned char jj=0;
+        std::vector<unsigned char> keypos;
+        if(fileld.size()>0){
+            for(;jj<fileld.size();jj++){
+                if(fileld[jj]==','){
+                    keypos.emplace_back(findcolpos(keyname)); 
+                    keyname.clear();
+                    continue;   
+                }
+                if(fileld[jj]==0x20){
 
 
-                                continue;   
-                            }
-                            keyname.push_back(fileld[jj]);
+                    continue;   
+                }
+                keyname.push_back(fileld[jj]);
 
 
-                    }  
-                    if(keyname.size()>0){
-                                    keypos.emplace_back(findcolpos(keyname)); 
-                                    keyname.clear();
-                    }
-                 }else{
-                     for(jj=0;jj<colnames.size();jj++){
-                         keypos.emplace_back(jj); 
-                     }
-                 }
-                tempsql<<"[";
-              for(size_t n=0;n<record.size();n++){
-                 keyname.clear();
-                 if(func(keyname,record[n])){ 
-                            if(n>0){
-                                tempsql<<",{";
-                            }else{
-                                tempsql<<"{";
-                            } 
-                            tempsql<<keyname;
-                 }else{
-                    continue;
-                 } 
-                  
-                 for(jj=0;jj<keypos.size();jj++){
-                        
-                       switch(keypos[jj]){
+            }  
+            if(keyname.size()>0){
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
+            }
+        }else{
+            for(jj=0;jj<col_names.size();jj++){
+                keypos.emplace_back(jj); 
+            }
+        }
+        tempsql<<"[";
+        for(size_t n=0;n<record.size();n++){
+            keyname.clear();
+            if(func(keyname,record[n])){ 
+                if(n>0){
+                    tempsql<<",{";
+                }else{
+                    tempsql<<"{";
+                } 
+                tempsql<<keyname;
+            }else{
+            continue;
+            } 
+        
+        for(jj=0;jj<keypos.size();jj++){
+            
+            switch(keypos[jj]){
          case 0:
          case 0:
  if(jj>0){ tempsql<<","; } 
  if(jj>0){ tempsql<<","; } 
 if(record[n].id==0){
 if(record[n].id==0){
@@ -1110,12 +1049,12 @@ tempsql<<"\"message\":\""<<http::utf8_to_jsonstring(record[n].message)<<"\"";
    }   
    }   
    long long getPK(){  return data.id; } 
    long long getPK(){  return data.id; } 
  void setPK(long long val){  data.id=val;} 
  void setPK(long long val){  data.id=val;} 
-unsigned  int  getId(){  return data.id; } 
- void setId(unsigned  int  val){  data.id=val;} 
+ unsigned  int  getId(){  return data.id; } 
+ void setId( unsigned  int  val){  data.id=val;} 
 
 
-std::string getMessage(){  return data.message; } 
-std::string& getRefMessage(){  return std::ref(data.message); } 
- void setMessage(std::string &val){  data.message=val;} 
+ std::string  getMessage(){  return data.message; } 
+ std::string & getRefMessage(){  return std::ref(data.message); } 
+ void setMessage( std::string  &val){  data.message=val;} 
  void setMessage(std::string_view val){  data.message=val;} 
  void setMessage(std::string_view val){  data.message=val;} 
 
 
 fortunebase::meta getnewData(){
 fortunebase::meta getnewData(){

+ 9628 - 0
frameworks/C++/paozhu/paozhu_benchmark/orm/include/world_mysql.h

@@ -0,0 +1,9628 @@
+#ifndef _ORM_DEFAULT_WORLD_OPERATE_H
+#define _ORM_DEFAULT_WORLD_OPERATE_H
+
+#include <iostream>
+#include <mutex>
+#include <string>
+#include <map>
+#include <set>
+#include <string_view>
+#include <thread>
+#include "request.h"
+#include "unicode.h"
+#include "datetime.h"
+#include <stdexcept>
+#include <iostream>
+#include <functional>
+#include <tuple>
+#include <typeinfo>
+#include <memory>
+#include <list>
+#include <queue>
+#include <cmath>
+#include <condition_variable>
+#include <sstream>
+#include <algorithm>
+#include <vector>
+
+#include "mysql_conn.h"
+#include "mysql_conn_pool.h"
+#include "orm_cache.hpp"
+/*baseincludefile*/
+namespace orm
+{
+// mysql Operational SQL middleware
+/*tagnamespace*/
+//{ /*tagnamespace_replace*/
+    template <typename M_MODEL, typename B_BASE>
+    class world_mysql : public B_BASE
+    {
+      public:
+        world_mysql(const std::string &tag) : dbtag(tag)
+        {
+            std::map<std::string, std::shared_ptr<orm_conn_pool>> &conn_pool_obj = get_orm_conn_pool_obj();
+            auto iter                                                            = conn_pool_obj.find(dbtag);
+            if (iter != conn_pool_obj.end())
+            {
+                conn_obj = iter->second;
+            }
+            else
+            {
+                conn_obj  = nullptr;
+                iserror   = true;
+                error_msg = "conn_pool not found " + dbtag;
+            }
+        }
+        world_mysql() : dbtag(B_BASE::_rmstag)
+        {
+            std::map<std::string, std::shared_ptr<orm_conn_pool>> &conn_pool_obj = get_orm_conn_pool_obj();
+            auto iter                                                            = conn_pool_obj.find(dbtag);
+            if (iter != conn_pool_obj.end())
+            {
+                conn_obj = iter->second;
+            }
+            else
+            {
+                conn_obj  = nullptr;
+                iserror   = true;
+                error_msg = "conn_pool not found " + dbtag;
+            }
+        }
+        M_MODEL &switchDB(const std::string &temptag)
+        {
+            std::map<std::string, std::shared_ptr<orm_conn_pool>> &conn_pool_obj = get_orm_conn_pool_obj();
+            auto iter                                                            = conn_pool_obj.find(temptag);
+            if (iter != conn_pool_obj.end())
+            {
+                conn_obj = iter->second;
+            }
+            else
+            {
+                conn_obj  = nullptr;
+                iserror   = true;
+                error_msg = "conn_pool not found " + temptag;
+            }
+        }
+        M_MODEL &set_table(const std::string &table_name)
+        {
+            if (original_tablename.empty())
+            {
+                original_tablename = B_BASE::tablename;
+            }
+            if (table_name.size() > 0)
+            {
+                B_BASE::tablename = table_name;
+            }
+            return *mod;
+        }
+        M_MODEL &reset_table()
+        {
+            if (original_tablename.empty())
+            {
+                return *mod;
+            }
+            B_BASE::tablename = original_tablename;
+            return *mod;
+        }
+        unsigned int count()
+        {
+            std::string countsql;
+            countsql = "SELECT count(*) as total_countnum  FROM ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" WHERE ");
+            if (wheresql.empty())
+            {
+                countsql.append(" 1 ");
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                //std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                querysql_len = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int tempnum = 0;
+
+                                unsigned int name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                querysql_len = 0;
+                                for (unsigned int ik = 0; ik < name_length; ik++)
+                                {
+                                    if (temp_pack_data.data[tempnum] >= '0' && temp_pack_data.data[tempnum] <= '9')
+                                    {
+                                        querysql_len = querysql_len * 10 + (temp_pack_data.data[tempnum] - '0');
+                                    }
+                                    tempnum++;
+                                }
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return querysql_len;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                return 0;
+            }
+
+            return 0;
+        }
+        std::tuple<unsigned int, unsigned int, unsigned int, unsigned int>
+        page(unsigned int page, unsigned int per_page = 10, unsigned int list_num = 5)
+        {
+            unsigned int total_page = count();
+            if (per_page == 0)
+            {
+                per_page = 10;
+            }
+            if (list_num < 1)
+            {
+                list_num = 1;
+            }
+            total_page = std::ceil((float)total_page / per_page);
+
+            if (total_page < 1)
+            {
+                total_page = 1;
+            }
+            if (page > total_page)
+            {
+                page = total_page;
+            }
+            if (page < 1)
+            {
+                page = 1;
+            }
+            unsigned int mid_num  = std::floor(list_num / 2);
+            unsigned int last_num = list_num - 1;
+
+            int temp_num = page - mid_num;
+
+            unsigned int minpage = temp_num < 1 ? 1 : temp_num;
+            unsigned int maxpage = minpage + last_num;
+
+            if (maxpage > total_page)
+            {
+                maxpage  = total_page;
+                temp_num = (maxpage - last_num);
+                if (temp_num < 1)
+                {
+                    minpage = 1;
+                }
+                else
+                {
+                    minpage = temp_num;
+                }
+            }
+            limit((page - 1) * per_page, per_page);
+            return std::make_tuple(minpage, maxpage, page, total_page);
+        }
+        asio::awaitable<unsigned int> async_count()
+        {
+            std::string countsql;
+            countsql = "SELECT count(*) as total_countnum  FROM ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" WHERE ");
+            if (wheresql.empty())
+            {
+                countsql.append(" 1 ");
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                //std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                querysql_len = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int tempnum = 0;
+
+                                unsigned int name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                querysql_len = 0;
+                                for (unsigned int ik = 0; ik < name_length; ik++)
+                                {
+                                    if (temp_pack_data.data[tempnum] >= '0' && temp_pack_data.data[tempnum] <= '9')
+                                    {
+                                        querysql_len = querysql_len * 10 + (temp_pack_data.data[tempnum] - '0');
+                                    }
+                                    tempnum++;
+                                }
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return querysql_len;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                co_return 0;
+            }
+            co_return 0;
+        }
+
+        asio::awaitable<std::tuple<unsigned int, unsigned int, unsigned int, unsigned int>>
+        async_page(unsigned int page, unsigned int per_page = 10, unsigned int list_num = 5)
+        {
+            unsigned int total_page = async_count();
+            if (per_page == 0)
+            {
+                per_page = 10;
+            }
+            if (list_num < 1)
+            {
+                list_num = 1;
+            }
+            total_page = std::ceil((float)total_page / per_page);
+
+            if (total_page < 1)
+            {
+                total_page = 1;
+            }
+            if (page > total_page)
+            {
+                page = total_page;
+            }
+            if (page < 1)
+            {
+                page = 1;
+            }
+            unsigned int mid_num  = std::floor(list_num / 2);
+            unsigned int last_num = list_num - 1;
+
+            int temp_num = page - mid_num;
+
+            unsigned int minpage = temp_num < 1 ? 1 : temp_num;
+            unsigned int maxpage = minpage + last_num;
+
+            if (maxpage > total_page)
+            {
+                maxpage  = total_page;
+                temp_num = (maxpage - last_num);
+                if (temp_num < 1)
+                {
+                    minpage = 1;
+                }
+                else
+                {
+                    minpage = temp_num;
+                }
+            }
+            limit((page - 1) * per_page, per_page);
+            co_return std::make_tuple(minpage, maxpage, page, total_page);
+        }
+
+        unsigned int update_col(std::string colname, int num, char symbol = '+')
+        {
+            effect_num = 0;
+            std::string countsql;
+            countsql = "UPDATE ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" SET ");
+            countsql.append(colname);
+            if (num > 0)
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.append(std::to_string(num));
+            }
+            else
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.push_back('(');
+                countsql.push_back('-');
+                countsql.append(std::to_string(std::abs(num)));
+                countsql.push_back(')');
+            }
+            countsql.append(" where ");
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    countsql.append(tempsql.str());
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    //insertid      = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_update_col(std::string colname, int num, char symbol = '+')
+        {
+            effect_num = 0;
+            std::string countsql;
+            countsql = "UPDATE ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" SET ");
+            countsql.append(colname);
+            if (num > 0)
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.append(std::to_string(num));
+            }
+            else
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.push_back('(');
+                countsql.push_back('-');
+                countsql.append(std::to_string(std::abs(num)));
+                countsql.push_back(')');
+            }
+            countsql.append(" where ");
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    countsql.append(tempsql.str());
+                }
+                else
+                {
+                    co_return 0;
+                }
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    //insertid      = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    co_return effect_num;
+                }
+
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            co_return 0;
+        }
+
+        int replace_col(std::string colname, const std::string &old_string, const std::string &new_string)
+        {
+            effect_num = 0;
+            std::string countsql;
+            countsql = "UPDATE ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" SET ");
+            countsql.append(colname);
+
+            countsql.append(" = REPLACE(");
+            countsql.append(colname);
+            countsql.append(",'");
+            countsql.append(old_string);
+            countsql.append("','");
+            countsql.append(new_string);
+            countsql.append("') ");
+
+            countsql.append(" where ");
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    countsql.append(tempsql.str());
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    //insertid      = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        void assign_field_value(unsigned char index_pos, unsigned char *result_temp_data, unsigned int value_size, typename B_BASE::meta &data_temp)
+    {
+        switch(index_pos)
+        {
+            case 0:
+            data_temp.id=0;
+            
+            for(unsigned int i=0; i< value_size; i++)
+            {
+                if(result_temp_data[i]>='0'&&result_temp_data[i]<='9')
+                {
+
+                data_temp.id= data_temp.id * 10 + (result_temp_data[i]-'0');
+                }   
+                if(i>32)
+                {
+                    break;
+                }
+            }
+            break;
+                case 1:
+            data_temp.randomnumber=0;
+            
+            for(unsigned int i=0; i< value_size; i++)
+            {
+                if(result_temp_data[i]>='0'&&result_temp_data[i]<='9')
+                {
+
+                data_temp.randomnumber= data_temp.randomnumber * 10 + (result_temp_data[i]-'0');
+                }   
+                if(i>32)
+                {
+                    break;
+                }
+            }
+            break;
+                
+        }
+    }
+    
+
+M_MODEL& eqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& nqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& inId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& inId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& inId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& ninId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& btId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& beId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& ltId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& leId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_eqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_nqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_inId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_ninId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_btId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_beId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ltId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_leId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& eqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& nqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& btId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& beId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& ltId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& leId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_eqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_nqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_btId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_beId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_ltId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_leId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+M_MODEL& eqRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber = ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& nqRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber != ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& inRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& inRandomnumber(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& inRandomnumber(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber NOT IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& ninRandomnumber(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninRandomnumber(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& btRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber > ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& beRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber >= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& ltRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber < ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& leRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber <= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_eqRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber = ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_nqRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber != ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_inRandomnumber(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inRandomnumber(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber NOT IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_ninRandomnumber(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninRandomnumber(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_btRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber > ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_beRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber >= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ltRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber < ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_leRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber <= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& eqRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber = ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& nqRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber != ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& btRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber > ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& beRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber >= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& ltRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber < ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& leRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber <= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_eqRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber = ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_nqRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber != ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_btRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber > ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_beRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber >= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_ltRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber < ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_leRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber <= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+        M_MODEL &select(const std::string &fieldname)
+        {
+            if (selectsql.size() > 0)
+            {
+                selectsql.push_back(',');
+            }
+            selectsql.append(fieldname);
+            return *mod;
+        }
+
+        M_MODEL &where(const std::string &wq)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(wq);
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &where(const std::string &wq, _SQL_Value val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+
+        M_MODEL &where(const std::string &wq, char bi, http::OBJ_VALUE &obj)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.push_back(bi);
+            if (obj.is_string())
+            {
+                wheresql.push_back('\'');
+                wheresql.append(obj.as_string());
+                wheresql.push_back('\'');
+            }
+            else
+            {
+
+                wheresql.append(obj.to_string());
+            }
+            return *mod;
+        }
+        M_MODEL &where(const std::string &wq, http::OBJ_VALUE &obj)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            if (obj.is_string())
+            {
+                wheresql.push_back('\'');
+                wheresql.append(obj.as_string());
+                wheresql.push_back('\'');
+            }
+            else
+            {
+
+                wheresql.append(obj.to_string());
+            }
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &where(const std::string &wq, char bi, _SQL_Value val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.push_back(bi);
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+
+        M_MODEL &where(const std::string &wq, char bi, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.push_back(bi);
+            wheresql.push_back('\'');
+
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+        M_MODEL &where(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+
+        M_MODEL &between(const std::string &wq, const std::string &a, const std::string &b)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(" (");
+            wheresql.append(wq);
+            wheresql.append(" BETWEEN '");
+            std::stringstream _stream;
+            _stream << a;
+            _stream << "' AND '";
+            _stream << b;
+            _stream << "' ) ";
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &between(const std::string &wq, _SQL_Value a, _SQL_Value b)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(" (");
+            wheresql.append(wq);
+            wheresql.append(" BETWEEN ");
+            std::stringstream _stream;
+            _stream << a;
+            _stream << " AND ";
+            _stream << b;
+            _stream << " ) ";
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &orBetween(const std::string &wq, _SQL_Value a, _SQL_Value b)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(" (");
+            wheresql.append(wq);
+            wheresql.append(" BETWEEN ");
+            std::stringstream _stream;
+            _stream << a;
+            _stream << " AND ";
+            _stream << b;
+            _stream << " ) ";
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        M_MODEL &whereLike(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            if (val.size() > 0 && (val[0] == '%' || val.back() == '%'))
+            {
+                wheresql.append(val);
+                wheresql.append("' ");
+            }
+            else
+            {
+                wheresql.push_back('%');
+                wheresql.append(val);
+                wheresql.append("%' ");
+            }
+            return *mod;
+        }
+        M_MODEL &whereLikeLeft(const std::string &wq, const std::string &val)
+        {
+
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            wheresql.push_back('%');
+            wheresql.append(val);
+            wheresql.append("' ");
+            return *mod;
+        }
+        M_MODEL &whereLikeRight(const std::string &wq, const std::string &val)
+        {
+
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            wheresql.append(val);
+            wheresql.append("%' ");
+            return *mod;
+        }
+        M_MODEL &whereOrLike(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            if (val[0] == '%' || val.back() == '%')
+            {
+                wheresql.append(val);
+                wheresql.append("' ");
+            }
+            else
+            {
+                wheresql.push_back('%');
+                wheresql.append(val);
+                wheresql.append("%' ");
+            }
+            return *mod;
+        }
+        M_MODEL &whereAnd(const std::string &wq)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereAnd(const std::string &wq, _SQL_Value val)
+        {
+
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        M_MODEL &whereAnd(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+
+            return *mod;
+        }
+        M_MODEL &whereOr(const std::string &wq)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereOr(const std::string &wq, _SQL_Value val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        M_MODEL &whereOr(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+        M_MODEL &whereIn(const std::string &k)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(k);
+            return *mod;
+        }
+        M_MODEL &whereIn(const std::string &k, const std::string &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" IN(");
+            wheresql.append(a);
+            wheresql.append(") ");
+            return *mod;
+        }
+
+        M_MODEL &whereIn(const std::string &k, const std::vector<std::string> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(k);
+            wheresql.append(" in(");
+            int i = 0;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",\'");
+                }
+                else
+                {
+                    wheresql.append("\'");
+                }
+                wheresql.append(key);
+                wheresql.append("\'");
+                i++;
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+        M_MODEL &whereNotIn(const std::string &k, const std::vector<std::string> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" NOT IN(");
+            int i = 0;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",\'");
+                }
+                else
+                {
+                    wheresql.append("\'");
+                }
+                wheresql.append(key);
+                wheresql.append("\'");
+                i++;
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereIn(const std::string &k, const std::list<_SQL_Value> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" in(");
+            int i = 0;
+            std::stringstream _stream;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",");
+                }
+                _stream << key;
+                wheresql.append(_stream.str());
+                i++;
+                _stream.str("");
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereIn(const std::string &k, const std::vector<_SQL_Value> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" IN(");
+            int i = 0;
+            std::stringstream _stream;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",");
+                }
+                _stream << key;
+                wheresql.append(_stream.str());
+                i++;
+                _stream.str("");
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereNotIn(const std::string &k, const std::vector<_SQL_Value> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" NOT IN(");
+            int i = 0;
+            std::stringstream _stream;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",");
+                }
+                _stream << key;
+                wheresql.append(_stream.str());
+                i++;
+                _stream.str("");
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+
+        M_MODEL &order(const std::string &wq)
+        {
+            ordersql.append(" ORDER by ");
+            ordersql.append(wq);
+            return *mod;
+        }
+        M_MODEL &asc(const std::string &wq)
+        {
+
+            ordersql.append(" ORDER by ");
+            ordersql.append(wq);
+            ordersql.append(" ASC ");
+            return *mod;
+        }
+
+        M_MODEL &desc(const std::string &wq)
+        {
+
+            ordersql.append(" ORDER by ");
+            ordersql.append(wq);
+            ordersql.append(" DESC ");
+            return *mod;
+        }
+
+        M_MODEL &having(const std::string &wq)
+        {
+
+            groupsql.append(" HAVING by ");
+            groupsql.append(wq);
+            return *mod;
+        }
+
+        M_MODEL &group(const std::string &wq)
+        {
+
+            groupsql.append(" GROUP BY ");
+            groupsql.append(wq);
+            return *mod;
+        }
+
+        M_MODEL &orsub()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            else
+            {
+                wheresql.append(" OR (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+            return *mod;
+        }
+        M_MODEL &andsub()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao = false;
+                wheresql.append(" )");
+                ishascontent = false;
+            }
+            else
+            {
+                wheresql.append(" AND (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+
+            return *mod;
+        }
+
+        M_MODEL &endsub()
+        {
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            return *mod;
+        }
+
+        M_MODEL &or_b()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            else
+            {
+                wheresql.append(" OR (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+            return *mod;
+        }
+        M_MODEL &and_b()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao = false;
+                wheresql.append(" )");
+                ishascontent = false;
+            }
+            else
+            {
+                wheresql.append(" AND (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+
+            return *mod;
+        }
+
+        M_MODEL &or_e()
+        {
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            return *mod;
+        }
+
+        M_MODEL &and_e()
+        {
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            return *mod;
+        }
+
+        M_MODEL &limit(unsigned int num)
+        {
+            limitsql.clear();
+            limitsql.append(" limit ");
+            limitsql.append(std::to_string(num));
+            return *mod;
+        }
+        M_MODEL &limit(unsigned int num, unsigned int endnum)
+        {
+            limitsql.clear();
+            limitsql.append(" limit ");
+            limitsql.append(std::to_string(num));
+            limitsql.push_back(',');
+            limitsql.append(std::to_string(endnum));
+            return *mod;
+        }
+
+        std::vector<std::map<std::string, std::string>> fetch_obj()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            std::vector<std::map<std::string, std::string>> temprecord;
+
+            if (iserror)
+            {
+                return temprecord;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    return temprecord;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return temprecord;
+                }
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::map<std::string, std::string> data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    std::string temp_str;
+                                    temp_str.resize(name_length);
+                                    std::memcpy(temp_str.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    if (field_array[ij].name.size() > 0)
+                                    {
+                                        data_temp.insert({field_array[ij].name, std::move(temp_str)});
+                                    }
+                                    else if (field_array[ij].org_name.size() > 0)
+                                    {
+                                        data_temp.insert({field_array[ij].org_name, std::move(temp_str)});
+                                    }
+
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return temprecord;
+        }
+        std::tuple<std::vector<std::string>, std::map<std::string, unsigned int>, std::vector<std::vector<std::string>>>
+        fetch_row()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            std::vector<std::vector<std::string>> temprecord;
+            std::vector<std::string> table_fieldname;
+            std::map<std::string, unsigned int> table_fieldmap;
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+
+                model_meta_cache<std::vector<std::string>> &temp_cache =
+                    model_meta_cache<std::vector<std::string>>::getinstance();
+                temprecord = temp_cache.get(sqlhashid);
+                if (temprecord.size() > 0)
+                {
+                    iscache                                    = false;
+                    model_meta_cache<std::string> &table_cache = model_meta_cache<std::string>::getinstance();
+                    table_fieldname                            = table_cache.get(sqlhashid);
+
+                    model_meta_cache<std::map<std::string, unsigned int>> &tablemap_cache =
+                        model_meta_cache<std::map<std::string, unsigned int>>::getinstance();
+                    table_fieldmap = tablemap_cache.get_obj(sqlhashid);
+
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+            }
+
+            if (iserror)
+            {
+                return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                // std::vector<std::vector<std::string>> field_value;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                        table_fieldmap.insert({field_array[ii].org_name,table_fieldname.size()});
+                                        table_fieldname.push_back(field_array[ii].org_name);
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::vector<std::string> temp_v_record; 
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+                                    std::string tempstr;
+                                    tempstr.resize(name_length);
+                                    std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    temp_v_record.push_back(std::move(tempstr));
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.push_back(temp_v_record);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        if (temprecord.size() > 0)
+                        {
+                            std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+
+                            model_meta_cache<std::vector<std::string>> &temp_cache =
+                                model_meta_cache<std::vector<std::string>>::getinstance();
+                            temp_cache.save(sqlhashid, temprecord, exptime);
+
+                            exptime += 1;
+                            model_meta_cache<std::string> &table_cache = model_meta_cache<std::string>::getinstance();
+                            table_cache.save(sqlhashid, table_fieldname, exptime);
+
+                            model_meta_cache<std::map<std::string, unsigned int>> &tablemap_cache =
+                                model_meta_cache<std::map<std::string, unsigned int>>::getinstance();
+                            tablemap_cache.save(sqlhashid, table_fieldmap, exptime);
+                            exptime = 0;
+                            iscache = false;
+                        }
+                    }
+                }
+
+                return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord));
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+        }
+        M_MODEL &fetch()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return *mod;
+                }
+            }
+
+            B_BASE::record_reset();
+            if (iserror)
+            {
+                return *mod;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return *mod;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return *mod;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return *mod;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return *mod;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return *mod;
+        }
+
+        asio::awaitable<unsigned int> async_fetch()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 0;
+                }
+            }
+
+            B_BASE::record_reset();
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+        M_MODEL &fetch_append()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return *mod;
+                }
+            }
+
+            if (iserror)
+            {
+                return *mod;
+            }
+ 
+            try
+            {
+ 
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+                
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return *mod;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return *mod;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return *mod;
+        }
+
+        asio::awaitable<unsigned int> async_fetch_append()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 1;
+                }
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                // asio::error_code ec;
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                // std::vector<std::vector<std::string>> field_value;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+                // std::map<unsigned char, std::string> other_col;
+
+                for (; is_sql_item == false;)
+                {
+                    // std::memset(result_data, 0x00, 4096);
+                    // n      = co_await conn->socket->async_read_some(asio::buffer(result_data), asio::use_awaitable);
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                effect_num++;
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+        unsigned int fetch_one(bool isappend = false)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+
+            sqlstring.append(" limit 1");
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                if (isappend)
+                                {
+                                    typename B_BASE::meta data_temp;
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    B_BASE::record.emplace_back(std::move(data_temp));
+                                    effect_num++;
+                                }
+                                else
+                                {
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    effect_num++;
+                                }
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_fetch_one(bool isappend = false)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+
+            sqlstring.append(" limit 1");
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                // std::vector<std::vector<std::string>> field_value;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+                // std::map<unsigned char, std::string> other_col;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                if (isappend)
+                                {
+                                    typename B_BASE::meta data_temp;
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    B_BASE::record.emplace_back(std::move(data_temp));
+                                    effect_num++;
+                                }
+                                else
+                                {
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    effect_num++;
+                                }
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        M_MODEL &use_cache(int cache_time = 0)
+        {
+            iscache = true;
+            exptime = cache_time;
+            return *mod;
+        }
+        bool isuse_cache(bool iscachedate = false)
+        {
+            if (iscachedate)
+            {
+                return exptime == 0 && iscache == false;
+            }
+            return iscache;
+        }
+        void set_cache_state(bool isrestatus = false) { iscache = isrestatus; }
+        void remove_exptime_cache()
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.remove_exptime();
+        }
+        void clear_cache()
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.clear();
+        }
+        bool remove_cache()
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            std::size_t sqlhashid                               = std::hash<std::string>{}(sqlstring);
+            return temp_cache.remove(sqlhashid);
+        }
+        bool remove_cache(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            return temp_cache.remove(cache_key_name);
+        }
+        int check_cache(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            return temp_cache.check(cache_key_name);
+        }
+        std::vector<typename B_BASE::meta> get_cache_data(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            auto cache_data                                     = temp_cache.get(cache_key_name);
+            return cache_data;
+        }
+        typename B_BASE::meta get_cache_obj(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            auto cache_data                                     = temp_cache.get_obj(cache_key_name);
+            return cache_data;
+        }
+        M_MODEL &get_cache(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            B_BASE::record                                      = temp_cache.get(cache_key_name);
+            if (B_BASE::record.size() == 0)
+            {
+                B_BASE::record_reset();
+            }
+            else
+            {
+                B_BASE::data = B_BASE::record[0];
+            }
+            return *mod;
+        }
+        int update_cache(int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            std::size_t sqlhashid                               = std::hash<std::string>{}(sqlstring);
+            return temp_cache.update(sqlhashid, exp_time);
+        }
+        int update_cache(std::size_t cache_key_name, int exp_time)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            return temp_cache.update(cache_key_name, exp_time);
+        }
+        bool save_cache(int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            std::size_t sqlhashid                               = std::hash<std::string>{}(sqlstring);
+            temp_cache.save(sqlhashid, B_BASE::record, exp_time);
+            return true;
+        }
+
+        bool save_cache(std::size_t cache_key_name, typename B_BASE::meta &cache_data, int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.save(cache_key_name, cache_data, exp_time);
+            return true;
+        }
+
+        bool save_cache(std::size_t cache_key_name, std::vector<typename B_BASE::meta> &cache_data, int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.save(cache_key_name, cache_data, exp_time);
+            return true;
+        }
+        bool get_cacherecord(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            B_BASE::record                                      = temp_cache.get(cache_key_name);
+            if (B_BASE::record.size() == 0)
+            {
+                return false;
+            }
+            else
+            {
+                B_BASE::data = B_BASE::record[0];
+                return true;
+            }
+        }
+        http::OBJ_VALUE fetch_json()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            http::OBJ_VALUE valuetemp;
+            valuetemp.set_array();
+
+            if (iserror)
+            {
+                return valuetemp;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+ 
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                http::OBJ_VALUE json_temp_v;  
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    std::string temp_str;    
+                                    temp_str.resize(name_length);
+                                    std::memcpy(temp_str.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    if(field_array[ij].name.size()>0)
+                                    {
+                                        //or alias name
+                                        json_temp_v[field_array[ij].name]=std::move(temp_str);
+                                    }
+                                    else if(field_array[ij].org_name.size()>0)
+                                    {
+                                        json_temp_v[field_array[ij].org_name]=std::move(temp_str);
+                                    }
+                                    tempnum = tempnum + name_length;
+                                }
+                                valuetemp.push(json_temp_v);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return valuetemp;
+        }
+
+        asio::awaitable<http::OBJ_VALUE> async_fetch_json()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            http::OBJ_VALUE valuetemp;
+            valuetemp.set_array();
+
+            if (iserror)
+            {
+                co_return valuetemp;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return valuetemp;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+ 
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                http::OBJ_VALUE json_temp_v;  
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    std::string temp_str;    
+                                    temp_str.resize(name_length);
+                                    std::memcpy(temp_str.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    if(field_array[ij].name.size()>0)
+                                    {
+                                        //or alias name
+                                        json_temp_v[field_array[ij].name]=std::move(temp_str);
+                                    }
+                                    else if(field_array[ij].org_name.size()>0)
+                                    {
+                                        json_temp_v[field_array[ij].org_name]=std::move(temp_str);
+                                    }
+                                    tempnum = tempnum + name_length;
+                                }
+                                valuetemp.push(json_temp_v);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return valuetemp;
+        }
+
+        long long get_one(long long id)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+            sqlstring.append(" limit 1");
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                    tempnum = tempnum + name_length;
+                                }
+                                 
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);               
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_get_one(long long id)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+            sqlstring.append(" limit 1");
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                    tempnum = tempnum + name_length;
+                                }
+                                 
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);               
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        int update()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            sqlstring = B_BASE::_makeupdatesql("");
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        int update(const std::string &fieldname)
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    error_msg = "warning empty where sql!";
+                    return 0;
+                }
+            }
+
+            sqlstring = B_BASE::_makeupdatesql(fieldname);
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        asio::awaitable<int> async_update(const std::string &fieldname)
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    error_msg = "warning empty where sql!";
+                    co_return 0;
+                }
+            }
+
+            sqlstring = B_BASE::_makeupdatesql(fieldname);
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                co_return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+            try
+            {
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                    iserror = true;
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+
+            }
+            co_return 0;
+        }
+        asio::awaitable<int> async_update()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    error_msg = "warning empty where sql!";
+                    co_return 0;
+                }
+            }
+
+            sqlstring = B_BASE::_makeupdatesql("");
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                co_return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+            try
+            {
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                    iserror = true;
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+
+            }
+            co_return 0;
+        }
+
+        int update_batch(const std::string &fieldname)
+        {
+            effect_num = 0;
+            if (B_BASE::record.size() == 0)
+            {
+                return 0;
+            }
+            if (fieldname.size() > 0)
+            {
+                sqlstring = B_BASE::_make_insert_into_sql(fieldname);
+            }
+            else
+            {
+                sqlstring = B_BASE::_make_replace_into_sql();
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        int remove()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+
+            sqlstring = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_remove()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    co_return 0;
+                }
+            }
+
+            sqlstring = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                co_return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            co_return 0;
+        }
+
+        int remove(long long id)
+        {
+            effect_num = 0;
+            sqlstring  = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_remove(long long id)
+        {
+            effect_num = 0;
+            sqlstring  = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            co_return 0;
+        }
+
+        int soft_remove(const std::string &fieldsql)
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+
+            sqlstring = B_BASE::soft_remove_sql(fieldsql);
+            if (sqlstring.empty())
+            {
+                error_msg = "soft delete field empty.";
+                return 0;
+            }
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        int soft_remove()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    effect_num = 1;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            if (effect_num == 1)
+            {
+                sqlstring = B_BASE::soft_remove_sql(" ");
+            }
+            else
+            {
+                sqlstring = B_BASE::soft_remove_sql("");
+            }
+            effect_num = 0;
+            if (sqlstring.empty())
+            {
+                error_msg = "soft delete field empty.";
+                return 0;
+            }
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        long long insert(typename B_BASE::meta &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_insert(typename B_BASE::meta &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    co_return insert_last_id;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        long long insert(std::vector<typename B_BASE::meta> &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_insert(std::vector<typename B_BASE::meta> &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    co_return insert_last_id;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        long long insert()
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makeinsertsql();
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_insert()
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makeinsertsql();
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    co_return insert_last_id;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+
+        long long save(bool isrealnew = false)
+        {
+            effect_num = 0;
+            if (B_BASE::getPK() > 0 && isrealnew == false)
+            {
+                if (wheresql.empty())
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                sqlstring = B_BASE::_makeupdatesql("");
+                sqlstring.append(" where ");
+                if (wheresql.empty())
+                {
+                    return 0;
+                }
+                else
+                {
+                    sqlstring.append(wheresql);
+                }
+                if (!groupsql.empty())
+                {
+                    sqlstring.append(groupsql);
+                }
+                if (!ordersql.empty())
+                {
+                    sqlstring.append(ordersql);
+                }
+                if (!limitsql.empty())
+                {
+                    sqlstring.append(limitsql);
+                }
+                if (iscommit)
+                {
+                    iscommit = false;
+                    return 0;
+                }
+
+                if (iserror)
+                {
+                    return 0;
+                }
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            else
+            {
+                sqlstring  = B_BASE::_makeinsertsql();
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_save(bool isrealnew = false)
+        {
+            effect_num = 0;
+            if (B_BASE::getPK() > 0 && isrealnew == false)
+            {
+                if (wheresql.empty())
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                sqlstring = B_BASE::_makeupdatesql("");
+                sqlstring.append(" where ");
+                if (wheresql.empty())
+                {
+                    co_return 0;
+                }
+                else
+                {
+                    sqlstring.append(wheresql);
+                }
+                if (!groupsql.empty())
+                {
+                    sqlstring.append(groupsql);
+                }
+                if (!ordersql.empty())
+                {
+                    sqlstring.append(ordersql);
+                }
+                if (!limitsql.empty())
+                {
+                    sqlstring.append(limitsql);
+                }
+                if (iscommit)
+                {
+                    iscommit = false;
+                    co_return 0;
+                }
+
+                if (iserror)
+                {
+                    co_return 0;
+                }
+
+                try
+                {
+                    if (conn_empty())
+                    {
+                        co_return 0;
+                    }
+                    auto conn = co_await conn_obj->async_get_edit_conn();
+
+                    unsigned int querysql_len = sqlstring.length() + 1;
+
+                    conn->send_data.clear();
+                    conn->send_data.push_back((querysql_len & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                    conn->send_data.push_back(0x00);
+                    conn->send_data.push_back(0x03);
+                    conn->send_data.append(sqlstring);
+
+                    std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                    unsigned int offset = 0;
+                    n                   = co_await conn->async_read_loop();
+
+                    pack_info_t temp_pack_data;
+                    temp_pack_data.seq_id = 1;
+                    conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                    conn_obj->back_edit_conn(conn);
+
+                    if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                    {
+                        error_msg = temp_pack_data.data.substr(3);
+                        iserror = true;
+                    }
+                    else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                    {
+
+                        unsigned int d_offset = 1;
+                        effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+
+                        co_return effect_num;
+                    }
+                    co_return 0;
+                }
+                catch (const std::exception &e)
+                {
+                    error_msg = std::string(e.what());
+                    co_return 0;
+                }
+                catch (const std::string &e)
+                {
+                    error_msg = e;
+                }
+                catch (...)
+                {
+                    co_return 0;
+                }
+                co_return 0;
+            }
+            else
+            {
+                sqlstring  = B_BASE::_makeinsertsql();
+                try
+                {
+                    if (conn_empty())
+                    {
+                        co_return 0;
+                    }
+                    auto conn = co_await conn_obj->async_get_edit_conn();
+
+                    unsigned int querysql_len = sqlstring.length() + 1;
+
+                    conn->send_data.clear();
+                    conn->send_data.push_back((querysql_len & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                    conn->send_data.push_back(0x00);
+                    conn->send_data.push_back(0x03);
+                    conn->send_data.append(sqlstring);
+
+                    std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                    
+                    unsigned int offset = 0;
+                    n                   = co_await conn->async_read_loop();
+
+                    pack_info_t temp_pack_data;
+                    temp_pack_data.seq_id = 1;
+                    conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                    conn_obj->back_edit_conn(conn);
+
+                    if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                    {
+                        error_msg = temp_pack_data.data.substr(3);
+                    }
+                    else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                    {
+
+                        unsigned int d_offset = 1;
+                        effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                        long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                        co_return insert_last_id;
+                    }
+                    co_return 0;
+                }
+                catch (const std::exception &e)
+                {
+                    error_msg = std::string(e.what());
+                }
+                catch (const std::string &e)
+                {
+                    error_msg = e;
+                }
+                catch (...)
+                {
+                }
+                co_return 0;
+            }
+            co_return 0;
+        }
+
+        std::tuple<std::vector<std::string>, std::map<std::string, unsigned int>, std::vector<std::vector<std::string>>>
+        query(const std::string &rawsql)
+        {
+
+            std::vector<std::vector<std::string>> temprecord;
+            std::vector<std::string> table_fieldname;
+            std::map<std::string, unsigned int> table_fieldmap;
+
+            if(rawsql.size()>10)
+            {
+                unsigned int i=0;
+                for(;i<rawsql.size();i++)
+                {
+                    if(rawsql[i]!=0x20)
+                    {
+                        break;
+                    }
+                }
+                if(i<5)
+                {
+                    //must be select
+                    if(rawsql[i]!='s' && rawsql[i]!='S')
+                    {
+                        iserror = true;   
+                    }
+                }
+                else
+                {
+                    iserror = true;   
+                }
+            }
+            else
+            {
+                iserror = true;   
+            }
+
+            if (iserror)
+            {
+                return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = rawsql.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(rawsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                        table_fieldmap.insert({field_array[ii].org_name,table_fieldname.size()});
+                                        table_fieldname.push_back(field_array[ii].org_name);
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::vector<std::string> temp_v_record; 
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+                                    std::string tempstr;
+                                    tempstr.resize(name_length);
+                                    std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    temp_v_record.push_back(std::move(tempstr));
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.push_back(temp_v_record);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord));
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+        }
+
+        asio::awaitable<std::tuple<std::vector<std::string>, std::map<std::string, unsigned int>, std::vector<std::vector<std::string>>>>
+        async_query(const std::string &rawsql)
+        {
+
+            std::vector<std::vector<std::string>> temprecord;
+            std::vector<std::string> table_fieldname;
+            std::map<std::string, unsigned int> table_fieldmap;
+
+            if(rawsql.size()>10)
+            {
+                unsigned int i=0;
+                for(;i<rawsql.size();i++)
+                {
+                    if(rawsql[i]!=0x20)
+                    {
+                        break;
+                    }
+                }
+                if(i<5)
+                {
+                    //must be select
+                    if(rawsql[i]!='s' && rawsql[i]!='S')
+                    {
+                        iserror = true;   
+                    }
+                }
+                else
+                {
+                    iserror = true;   
+                }
+            }
+            else
+            {
+                iserror = true;   
+            }
+
+            if (iserror)
+            {
+                co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = rawsql.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(rawsql);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                        table_fieldmap.insert({field_array[ii].org_name,table_fieldname.size()});
+                                        table_fieldname.push_back(field_array[ii].org_name);
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::vector<std::string> temp_v_record; 
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+                                    std::string tempstr;
+                                    tempstr.resize(name_length);
+                                    std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    temp_v_record.push_back(std::move(tempstr));
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.push_back(temp_v_record);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                co_return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord));
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+        }
+
+        // long long edit_query(const std::string &rawsql, bool isinsert = false)
+        // {
+        //     if (iserror)
+        //     {
+        //         return 0;
+        //     }
+
+        //     return 0;
+        // }
+        M_MODEL &clear(bool both = true)
+        {
+            selectsql.clear();
+            wheresql.clear();
+            ordersql.clear();
+            groupsql.clear();
+            limitsql.clear();
+            sqlstring.clear();
+            error_msg.clear();
+            iskuohao     = false;
+            ishascontent = false;
+            iscommit     = false;
+            iscache      = false;
+            effect_num   = 0;
+            if (both)
+            {
+                B_BASE::record_reset();
+                B_BASE::data_reset();
+            }
+            return *mod;
+        }
+        M_MODEL &clearWhere()
+        {
+            selectsql.clear();
+            wheresql.clear();
+            ordersql.clear();
+            groupsql.clear();
+            limitsql.clear();
+            sqlstring.clear();
+            error_msg.clear();
+            iskuohao     = false;
+            ishascontent = false;
+            iscommit     = false;
+            iscache      = false;
+            effect_num   = 0;
+            return *mod;
+        }
+        M_MODEL &set_data(typename B_BASE::meta indata)
+        {
+            B_BASE::data = indata;
+            return *mod;
+        }
+        M_MODEL &get() { return *mod; }
+        std::string get_query() { return sqlstring; }
+        M_MODEL &start_commit()
+        {
+            iscommit = true;
+            return *mod;
+        }
+        M_MODEL &end_commit()
+        {
+            iscommit = false;
+            return *mod;
+        }
+
+        unsigned int effect()
+        {
+            return effect_num;
+        }
+        bool conn_empty()
+        {
+            if (conn_obj)
+            {
+                return false; 
+            }
+            error_msg = "conn_obj is null";
+            iserror   = true;
+            return true;
+        }
+
+      public:
+        std::string selectsql;
+        std::string wheresql;
+        std::string ordersql;
+        std::string groupsql;
+        std::string limitsql;
+        std::string sqlstring;
+        std::string dbtag;
+        std::string error_msg;
+        std::string original_tablename;
+
+        // std::list<std::string> commit_sqllist;
+        bool iskuohao           = false;
+        bool iscommit           = false;
+        bool ishascontent       = false;
+        bool iscache            = false;
+        bool iserror            = false;
+        int exptime             = 0;
+        unsigned int effect_num = 0;
+
+        M_MODEL *mod;
+
+        std::shared_ptr<orm_conn_pool> conn_obj;
+    };
+//} /*tagnamespace_replace*/
+}// namespace orm
+#endif

+ 266 - 327
frameworks/C++/paozhu/paozhu_benchmark/orm/include/worldbase.h

@@ -2,7 +2,7 @@
 #define ORM_DEFAULT_WORLDBASEMATA_H
 #define ORM_DEFAULT_WORLDBASEMATA_H
 /*
 /*
 *This file is auto create from cli
 *This file is auto create from cli
-*本文件为自动生成 Fri, 26 Jan 2024 02:59:30 GMT
+*本文件为自动生成 Sun, 02 Mar 2025 10:54:30 GMT
 ***/
 ***/
 #include <iostream>
 #include <iostream>
 #include <cstdio>
 #include <cstdio>
@@ -14,28 +14,30 @@
 #include <vector>
 #include <vector>
 #include <ctime>
 #include <ctime>
 #include <array>
 #include <array>
-#include "mysql.h"
+#include "unicode.h"
+
 namespace orm { 
 namespace orm { 
    
    
     
     
 struct worldbase
 struct worldbase
 {
 {
     struct meta{
     struct meta{
-    unsigned  int id= 0; //
- int randomnumber= 0; //
+     unsigned  int  id = 0; ///**/
+ int  randomnumber = 0; ///**/
  } data;
  } data;
  std::vector<worldbase::meta> record;
  std::vector<worldbase::meta> record;
 std::string _rmstag="default";//this value must be default or tag value, tag in mysqlconnect config file .
 std::string _rmstag="default";//this value must be default or tag value, tag in mysqlconnect config file .
-std::vector<unsigned char> _keypos{0x00};
-MYSQL_ROW _row;
+unsigned int _offset=0;
 std::vector<worldbase::meta>::iterator begin(){     return record.begin(); }
 std::vector<worldbase::meta>::iterator begin(){     return record.begin(); }
 std::vector<worldbase::meta>::iterator end(){     return record.end(); }
 std::vector<worldbase::meta>::iterator end(){     return record.end(); }
 std::vector<worldbase::meta>::const_iterator begin() const{     return record.begin(); }
 std::vector<worldbase::meta>::const_iterator begin() const{     return record.begin(); }
 std::vector<worldbase::meta>::const_iterator end() const{     return record.end(); }
 std::vector<worldbase::meta>::const_iterator end() const{     return record.end(); }
-const std::array<std::string,2> colnames={"id","randomnumber"};
-const std::array<unsigned char,2> colnamestype= {3,3};
+static constexpr std::array<std::string_view,2> col_names={"id","randomnumber"};
+static constexpr std::array<unsigned char,2> col_types={3,3};
+static constexpr std::array<unsigned char,2> col_length={0,0};
+static constexpr std::array<unsigned char,2> col_decimals={0,0};
 std::string tablename="world";
 std::string tablename="world";
-std::string modelname="World";
+static constexpr std::string_view modelname="World";
 
 
 	  unsigned char findcolpos(const std::string &coln){
 	  unsigned char findcolpos(const std::string &coln){
             if(coln.size()==0)
             if(coln.size()==0)
@@ -82,70 +84,9 @@ break;
      
      
          return temp;
          return temp;
      }
      }
-     void _setColnamevalue()
-      {
-        for(unsigned char i=0;i<_keypos.size();i++)
-        {
-            switch(_keypos[i]){
-        	case 0:
-		 try{
-			data.id=std::stoul(_row[i]);
-		}catch (...) { 
-			data.id=0;
-			 }
-			break;
-	case 1:
-		 try{
-			data.randomnumber=std::stoi(_row[i]);
-		}catch (...) { 
-			data.randomnumber=0;
-			 }
-			break;
-	default:
-		 { }
-			
-
-                 }
-
-                 if(i>210){
-                     break;
-                 }
-          }
-   } 
-         void _addnewrowvalue(){
-           worldbase::meta metatemp;   
-
-          for(unsigned char i=0;i<_keypos.size();i++){
- 
-                 switch(_keypos[i]){
-
-        	case 0:
-		 try{
-			metatemp.id=std::stoul(_row[i]);
-		}catch (...) { 
-			metatemp.id=0;
-			 }
-			break;
-	case 1:
-		 try{
-			metatemp.randomnumber=std::stoi(_row[i]);
-		}catch (...) { 
-			metatemp.randomnumber=0;
-			 }
-			break;
-	default:
-		 { }
-			
-
-                  }
-                 if(i>210){
-                     break;
-                 }
-          }
-           record.emplace_back(std::move(metatemp)); 
-   } 
+     
 
 
-  inline  std::string stringaddslash(std::string &content){
+  inline  std::string stringaddslash(const std::string &content){
         std::string temp;
         std::string temp;
         for(unsigned int i=0;i<content.size();i++){
         for(unsigned int i=0;i<content.size();i++){
             if(content[i]=='\''){
             if(content[i]=='\''){
@@ -162,7 +103,7 @@ break;
         }
         }
         return temp;
         return temp;
    }  
    }  
-  inline  std::string jsonaddslash(std::string &content){
+  inline  std::string jsonaddslash(const std::string &content){
         std::string temp;
         std::string temp;
         for(unsigned int i=0;i<content.size();i++){
         for(unsigned int i=0;i<content.size();i++){
             if(content[i]=='"'){
             if(content[i]=='"'){
@@ -179,23 +120,23 @@ break;
    }  
    }  
 
 
    std::string _makeinsertsql(){
    std::string _makeinsertsql(){
-      unsigned int j=0;
-                std::ostringstream tempsql;
-                tempsql<<"INSERT INTO ";
-                    tempsql<<tablename;
-                   tempsql<<" (";
-                    for(;j<colnames.size();j++){
-                            if(j>0){
-                                tempsql<<"`,`";
-                            }else{
-                                tempsql<<"`";
-                            }
-                            tempsql<<colnames[j];
-                    }
-                    if(j>0){
-                        tempsql<<"`";
-                    }
-            tempsql<<") VALUES (";
+        unsigned int j=0;
+        std::ostringstream tempsql;
+        tempsql<<"INSERT INTO ";
+        tempsql<<tablename;
+        tempsql<<" (";
+        for(;j<col_names.size();j++){
+                if(j>0){
+                    tempsql<<"`,`";
+                }else{
+                    tempsql<<"`";
+                }
+                tempsql<<col_names[j];
+        }
+        if(j>0){
+            tempsql<<"`";
+        }
+        tempsql<<") VALUES (";
 
 
         if(data.id==0){
         if(data.id==0){
 tempsql<<"null";
 tempsql<<"null";
@@ -213,24 +154,24 @@ tempsql<<")";
        return tempsql.str();
        return tempsql.str();
    } 
    } 
       
       
-      std::string _makerecordinsertsql( meta &insert_data){
-      unsigned int j=0;
-                std::ostringstream tempsql;
-                tempsql<<"INSERT INTO ";
-                    tempsql<<tablename;
-                   tempsql<<" (";
-                    for(;j<colnames.size();j++){
-                            if(j>0){
-                                tempsql<<"`,`";
-                            }else{
-                                tempsql<<"`";
-                            }
-                            tempsql<<colnames[j];
-                    }
-                    if(j>0){
-                        tempsql<<"`";
-                    }
-            tempsql<<") VALUES (";
+      std::string _makerecordinsertsql(const meta &insert_data){
+        unsigned int j=0;
+        std::ostringstream tempsql;
+        tempsql<<"INSERT INTO ";
+        tempsql<<tablename;
+        tempsql<<" (";
+        for(;j<col_names.size();j++){
+                if(j>0){
+                    tempsql<<"`,`";
+                }else{
+                    tempsql<<"`";
+                }
+                tempsql<<col_names[j];
+        }
+        if(j>0){
+            tempsql<<"`";
+        }
+        tempsql<<") VALUES (";
 
 
         if(insert_data.id==0){
         if(insert_data.id==0){
 tempsql<<"null";
 tempsql<<"null";
@@ -248,35 +189,35 @@ tempsql<<")";
        return tempsql.str();
        return tempsql.str();
    } 
    } 
        
        
-      std::string _makerecordinsertsql( std::vector<meta> &insert_data){
-      unsigned int j=0;
-                std::ostringstream tempsql;
-                tempsql<<"INSERT INTO ";
-                    tempsql<<tablename;
-                   tempsql<<" (";
-                    for(;j<colnames.size();j++){
-                            if(j>0){
-                                tempsql<<"`,`";
-                            }else{
-                                tempsql<<"`";
-                            }
-                            tempsql<<colnames[j];
-                    }
-                    if(j>0){
-                        tempsql<<"`";
-                    }
-            tempsql<<") VALUES ";
+    std::string _makerecordinsertsql(const std::vector<meta> &insert_data){
+        unsigned int j=0;
+        std::ostringstream tempsql;
+        tempsql<<"INSERT INTO ";
+        tempsql<<tablename;
+        tempsql<<" (";
+        for(;j<col_names.size();j++){
+                if(j>0){
+                    tempsql<<"`,`";
+                }else{
+                    tempsql<<"`";
+                }
+                tempsql<<col_names[j];
+        }
+        if(j>0){
+            tempsql<<"`";
+        }
+        tempsql<<") VALUES ";
 
 
-    for(unsigned int i=0;i<insert_data.size();i++)
-    {
-		if(i>0)
-		{
-			tempsql<<",";	
-		}
-		tempsql<<"(";
+        for(unsigned int i=0;i<insert_data.size();i++)
+        {
+            if(i>0)
+            {
+                tempsql<<",";	
+            }
+            tempsql<<"(";
 
 
 
 
-        	if(insert_data[i].id==0){
+            	if(insert_data[i].id==0){
 	tempsql<<"null";
 	tempsql<<"null";
 	 }else{ 
 	 }else{ 
 	tempsql<<std::to_string(insert_data[i].id);
 	tempsql<<std::to_string(insert_data[i].id);
@@ -294,17 +235,16 @@ tempsql<<")";
    } 
    } 
        
        
     std::string _makeupdatesql(const std::string &fileld){
     std::string _makeupdatesql(const std::string &fileld){
-       //int j=0;
-            std::ostringstream tempsql;
-                 tempsql<<"UPDATE ";
-                 tempsql<<tablename;
-                 tempsql<<" SET ";
-
-            bool isall=false;
-            if(fileld.empty()){
-                isall=true;
-            }
-            if(isall){
+        std::ostringstream tempsql;
+        tempsql<<"UPDATE ";
+        tempsql<<tablename;
+        tempsql<<" SET ";
+
+        bool isall=false;
+        if(fileld.empty()){
+            isall=true;
+        }
+        if(isall){
 
 
         if(data.id==0){
         if(data.id==0){
 	tempsql<<"`id`=0";
 	tempsql<<"`id`=0";
@@ -327,7 +267,7 @@ if(data.randomnumber==0){
                                 unsigned char bpos_i=findcolpos(keyname);
                                 unsigned char bpos_i=findcolpos(keyname);
                                keypos.emplace_back(bpos_i); 
                                keypos.emplace_back(bpos_i); 
 #ifdef DEBUG
 #ifdef DEBUG
-                    if (bpos_i == 254)
+                    if (bpos_i == 255)
                     {
                     {
                         std::cout << "\033[1m\033[31m-----------\n"
                         std::cout << "\033[1m\033[31m-----------\n"
                                   << keyname << " not in " << tablename << " table Field.\n-----------\033[0m"
                                   << keyname << " not in " << tablename << " table Field.\n-----------\033[0m"
@@ -347,7 +287,7 @@ if(data.randomnumber==0){
                  if(keyname.size()>0){
                  if(keyname.size()>0){
                                 unsigned char bpos_i=findcolpos(keyname);
                                 unsigned char bpos_i=findcolpos(keyname);
  #ifdef DEBUG
  #ifdef DEBUG
-                    if (bpos_i == 254)
+                    if (bpos_i == 255)
                     {
                     {
                         std::cout << "\033[1m\033[31m-----------\n"
                         std::cout << "\033[1m\033[31m-----------\n"
                                   << keyname << " not in " << tablename << " table Field.\n-----------\033[0m"
                                   << keyname << " not in " << tablename << " table Field.\n-----------\033[0m"
@@ -395,7 +335,7 @@ if(data.randomnumber==0){
         tempsql << "REPLACE INTO ";
         tempsql << "REPLACE INTO ";
         tempsql << tablename;
         tempsql << tablename;
         tempsql << " (";
         tempsql << " (";
-        for (; j < colnames.size(); j++)
+        for (; j < col_names.size(); j++)
         {
         {
             if (j > 0)
             if (j > 0)
             {
             {
@@ -405,7 +345,7 @@ if(data.randomnumber==0){
             {
             {
                 tempsql << "`";
                 tempsql << "`";
             }
             }
-            tempsql << colnames[j];
+            tempsql << col_names[j];
         }
         }
         if (j > 0)
         if (j > 0)
         {
         {
@@ -443,7 +383,7 @@ if(data.randomnumber==0){
         tempsql << "INSERT INTO ";
         tempsql << "INSERT INTO ";
         tempsql << tablename;
         tempsql << tablename;
         tempsql << " (";
         tempsql << " (";
-        for (; j < colnames.size(); j++)
+        for (; j < col_names.size(); j++)
         {
         {
             if (j > 0)
             if (j > 0)
             {
             {
@@ -453,7 +393,7 @@ if(data.randomnumber==0){
             {
             {
                 tempsql << "`";
                 tempsql << "`";
             }
             }
-            tempsql << colnames[j];
+            tempsql << col_names[j];
         }
         }
         if (j > 0)
         if (j > 0)
         {
         {
@@ -483,33 +423,12 @@ if(data.randomnumber==0){
 	 tempsql<<" as new ON DUPLICATE KEY UPDATE ";
 	 tempsql<<" as new ON DUPLICATE KEY UPDATE ";
 
 
      
      
-    std::string keyname;
-    unsigned char jj=0;
-    j=0;
-     if(fileld.size()>0){
-            for(;jj<fileld.size();jj++){
-                    if(fileld[jj]==','){
-                        if(findcolpos(keyname)<255)
-                        {
-                            if(j>0)
-                            {
-                                tempsql<<",";
-                            }
-                            tempsql<<keyname;
-                            tempsql<<"=new.";
-                            tempsql<<keyname;
-                             
-                        }
-                        continue;   
-                    }
-                    if(fileld[jj]==0x20){
-
-                        continue;   
-                    }
-                    keyname.push_back(fileld[jj]);
-
-            }  
-            if(keyname.size()>0){
+        std::string keyname;
+        unsigned char jj=0;
+        j=0;
+        if(fileld.size()>0){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
                 if(findcolpos(keyname)<255)
                 if(findcolpos(keyname)<255)
                 {
                 {
                     if(j>0)
                     if(j>0)
@@ -519,10 +438,30 @@ if(data.randomnumber==0){
                     tempsql<<keyname;
                     tempsql<<keyname;
                     tempsql<<"=new.";
                     tempsql<<"=new.";
                     tempsql<<keyname;
                     tempsql<<keyname;
-                    
                 }
                 }
+                continue;   
             }
             }
-        } 
+            if(fileld[jj]==0x20){
+                continue;   
+            }
+            keyname.push_back(fileld[jj]);
+
+        }  
+        if(keyname.size()>0){
+            if(findcolpos(keyname)<255)
+            {
+                if(j>0)
+                {
+                    tempsql<<",";
+                }
+                tempsql<<keyname;
+                tempsql<<"=new.";
+                tempsql<<keyname;
+                
+            }
+        }
+
+    } 
  
  
  return tempsql.str();
  return tempsql.str();
 }
 }
@@ -534,30 +473,30 @@ if(data.randomnumber==0){
         std::vector<unsigned char> keypos;
         std::vector<unsigned char> keypos;
         if(fileld.size()>1){
         if(fileld.size()>1){
             for(;jj<fileld.size();jj++){
             for(;jj<fileld.size();jj++){
-                    if(fileld[jj]==','){
-                        keypos.emplace_back(findcolpos(keyname)); 
-                        keyname.clear();
-                        continue;   
-                    }
-                    if(fileld[jj]==0x20){
+                if(fileld[jj]==','){
+                    keypos.emplace_back(findcolpos(keyname)); 
+                    keyname.clear();
+                    continue;   
+                }
+                if(fileld[jj]==0x20){
 
 
-                        continue;   
-                    }
-                    keyname.push_back(fileld[jj]);
+                    continue;   
+                }
+                keyname.push_back(fileld[jj]);
 
 
             }  
             }  
             if(keyname.size()>0){
             if(keyname.size()>0){
-                            keypos.emplace_back(findcolpos(keyname)); 
-                            keyname.clear();
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
             }
             }
         }else{
         }else{
-            for(jj=0;jj<colnames.size();jj++){
+            for(jj=0;jj<col_names.size();jj++){
                 keypos.emplace_back(jj); 
                 keypos.emplace_back(jj); 
             }
             }
         }
         }
                
                
-                 for(jj=0;jj<keypos.size();jj++){
-                       switch(keypos[jj]){
+            for(jj=0;jj<keypos.size();jj++){
+                switch(keypos[jj]){
          case 0:
          case 0:
 if(data.id==0){
 if(data.id==0){
 	temparray.push_back("0");
 	temparray.push_back("0");
@@ -583,35 +522,35 @@ if(data.randomnumber==0){
    
    
    std::map<std::string,std::string> data_tomap(std::string fileld=""){
    std::map<std::string,std::string> data_tomap(std::string fileld=""){
        std::map<std::string,std::string> tempsql;
        std::map<std::string,std::string> tempsql;
-            std::string keyname;
-            unsigned char jj=0;
-                  std::vector<unsigned char> keypos;
-                  if(fileld.size()>1){
-                    for(;jj<fileld.size();jj++){
-                            if(fileld[jj]==','){
-                                keypos.emplace_back(findcolpos(keyname)); 
-                                keyname.clear();
-                                continue;   
-                            }
-                            if(fileld[jj]==0x20){
+        std::string keyname;
+        unsigned char jj=0;
+        std::vector<unsigned char> keypos;
+        if(fileld.size()>1){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
+                continue;   
+            }
+            if(fileld[jj]==0x20){
 
 
-                                continue;   
-                            }
-                            keyname.push_back(fileld[jj]);
+                continue;   
+            }
+            keyname.push_back(fileld[jj]);
 
 
-                    }  
-                    if(keyname.size()>0){
-                                    keypos.emplace_back(findcolpos(keyname)); 
-                                    keyname.clear();
-                    }
-                 }else{
-                     for(jj=0;jj<colnames.size();jj++){
-                         keypos.emplace_back(jj); 
-                     }
-                 }
-                
-                 for(jj=0;jj<keypos.size();jj++){
-                       switch(keypos[jj]){
+        }  
+        if(keyname.size()>0){
+            keypos.emplace_back(findcolpos(keyname)); 
+            keyname.clear();
+        }
+        }else{
+            for(jj=0;jj<col_names.size();jj++){
+                keypos.emplace_back(jj); 
+            }
+        }
+    
+        for(jj=0;jj<keypos.size();jj++){
+            switch(keypos[jj]){
          case 0:
          case 0:
 if(data.id==0){
 if(data.id==0){
 	tempsql.insert({"id","0"});
 	tempsql.insert({"id","0"});
@@ -656,36 +595,36 @@ tempsql<<"}";
    }   
    }   
    
    
    std::string data_tojson(std::string fileld){
    std::string data_tojson(std::string fileld){
-       std::ostringstream tempsql;
-            std::string keyname;
-            unsigned char jj=0;
-                  std::vector<unsigned char> keypos;
-                  if(fileld.size()>0){
-                    for(;jj<fileld.size();jj++){
-                            if(fileld[jj]==','){
-                                keypos.emplace_back(findcolpos(keyname)); 
-                                keyname.clear();
-                                continue;   
-                            }
-                            if(fileld[jj]==0x20){
+        std::ostringstream tempsql;
+        std::string keyname;
+        unsigned char jj=0;
+        std::vector<unsigned char> keypos;
+        if(fileld.size()>0){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
+                continue;   
+            }
+            if(fileld[jj]==0x20){
 
 
-                                continue;   
-                            }
-                            keyname.push_back(fileld[jj]);
+                continue;   
+            }
+            keyname.push_back(fileld[jj]);
 
 
-                    }  
-                    if(keyname.size()>0){
-                                    keypos.emplace_back(findcolpos(keyname)); 
-                                    keyname.clear();
-                    }
-                 }else{
-                     for(jj=0;jj<colnames.size();jj++){
-                         keypos.emplace_back(jj); 
-                     }
-                 }
-                 tempsql<<"{";
-                 for(jj=0;jj<keypos.size();jj++){
-                       switch(keypos[jj]){
+        }  
+        if(keyname.size()>0){
+            keypos.emplace_back(findcolpos(keyname)); 
+            keyname.clear();
+        }
+        }else{
+            for(jj=0;jj<col_names.size();jj++){
+                keypos.emplace_back(jj); 
+            }
+        }
+        tempsql<<"{";
+        for(jj=0;jj<keypos.size();jj++){
+            switch(keypos[jj]){
          case 0:
          case 0:
  if(jj>0){ tempsql<<","; } 
  if(jj>0){ tempsql<<","; } 
 if(data.id==0){
 if(data.id==0){
@@ -1024,43 +963,43 @@ if(data.randomnumber==0){
    } 
    } 
     
     
    std::string to_json(std::string fileld=""){
    std::string to_json(std::string fileld=""){
-       std::ostringstream tempsql;
-            std::string keyname;
-            unsigned char jj=0;
-                  std::vector<unsigned char> keypos;
-                  if(fileld.size()>0){
-                    for(;jj<fileld.size();jj++){
-                            if(fileld[jj]==','){
-                                keypos.emplace_back(findcolpos(keyname)); 
-                                keyname.clear();
-                                continue;   
-                            }
-                            if(fileld[jj]==0x20){
+    std::ostringstream tempsql;
+    std::string keyname;
+    unsigned char jj=0;
+    std::vector<unsigned char> keypos;
+    if(fileld.size()>0){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
+                continue;   
+            }
+            if(fileld[jj]==0x20){
 
 
-                                continue;   
-                            }
-                            keyname.push_back(fileld[jj]);
+                continue;   
+            }
+            keyname.push_back(fileld[jj]);
 
 
-                    }  
-                    if(keyname.size()>0){
-                                    keypos.emplace_back(findcolpos(keyname)); 
-                                    keyname.clear();
-                    }
-                 }else{
-                     for(jj=0;jj<colnames.size();jj++){
-                         keypos.emplace_back(jj); 
-                     }
-                 }
-                tempsql<<"[";
-              for(size_t n=0;n<record.size();n++){
-                  if(n>0){
-                      tempsql<<",{";
-                  }else{
-                      tempsql<<"{";
-                  }  
-                 
-                 for(jj=0;jj<keypos.size();jj++){
-                       switch(keypos[jj]){
+        }  
+        if(keyname.size()>0){
+            keypos.emplace_back(findcolpos(keyname)); 
+            keyname.clear();
+        }
+    }else{
+        for(jj=0;jj<col_names.size();jj++){
+            keypos.emplace_back(jj); 
+        }
+    }
+    tempsql<<"[";
+    for(size_t n=0;n<record.size();n++){
+        if(n>0){
+            tempsql<<",{";
+        }else{
+            tempsql<<"{";
+        }  
+    
+        for(jj=0;jj<keypos.size();jj++){
+            switch(keypos[jj]){
          case 0:
          case 0:
  if(jj>0){ tempsql<<","; } 
  if(jj>0){ tempsql<<","; } 
 if(record[n].id==0){
 if(record[n].id==0){
@@ -1090,49 +1029,49 @@ if(record[n].randomnumber==0){
    
    
    std::string to_json(std::function<bool(std::string&,meta&)> func,std::string fileld=""){
    std::string to_json(std::function<bool(std::string&,meta&)> func,std::string fileld=""){
        std::ostringstream tempsql;
        std::ostringstream tempsql;
-            std::string keyname;
-            unsigned char jj=0;
-                  std::vector<unsigned char> keypos;
-                  if(fileld.size()>0){
-                    for(;jj<fileld.size();jj++){
-                            if(fileld[jj]==','){
-                                keypos.emplace_back(findcolpos(keyname)); 
-                                keyname.clear();
-                                continue;   
-                            }
-                            if(fileld[jj]==0x20){
+        std::string keyname;
+        unsigned char jj=0;
+        std::vector<unsigned char> keypos;
+        if(fileld.size()>0){
+            for(;jj<fileld.size();jj++){
+                if(fileld[jj]==','){
+                    keypos.emplace_back(findcolpos(keyname)); 
+                    keyname.clear();
+                    continue;   
+                }
+                if(fileld[jj]==0x20){
 
 
-                                continue;   
-                            }
-                            keyname.push_back(fileld[jj]);
+                    continue;   
+                }
+                keyname.push_back(fileld[jj]);
 
 
-                    }  
-                    if(keyname.size()>0){
-                                    keypos.emplace_back(findcolpos(keyname)); 
-                                    keyname.clear();
-                    }
-                 }else{
-                     for(jj=0;jj<colnames.size();jj++){
-                         keypos.emplace_back(jj); 
-                     }
-                 }
-                tempsql<<"[";
-              for(size_t n=0;n<record.size();n++){
-                 keyname.clear();
-                 if(func(keyname,record[n])){ 
-                            if(n>0){
-                                tempsql<<",{";
-                            }else{
-                                tempsql<<"{";
-                            } 
-                            tempsql<<keyname;
-                 }else{
-                    continue;
-                 } 
-                  
-                 for(jj=0;jj<keypos.size();jj++){
-                        
-                       switch(keypos[jj]){
+            }  
+            if(keyname.size()>0){
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
+            }
+        }else{
+            for(jj=0;jj<col_names.size();jj++){
+                keypos.emplace_back(jj); 
+            }
+        }
+        tempsql<<"[";
+        for(size_t n=0;n<record.size();n++){
+            keyname.clear();
+            if(func(keyname,record[n])){ 
+                if(n>0){
+                    tempsql<<",{";
+                }else{
+                    tempsql<<"{";
+                } 
+                tempsql<<keyname;
+            }else{
+            continue;
+            } 
+        
+        for(jj=0;jj<keypos.size();jj++){
+            
+            switch(keypos[jj]){
          case 0:
          case 0:
  if(jj>0){ tempsql<<","; } 
  if(jj>0){ tempsql<<","; } 
 if(record[n].id==0){
 if(record[n].id==0){
@@ -1161,8 +1100,8 @@ if(record[n].randomnumber==0){
    }   
    }   
    long long getPK(){  return data.id; } 
    long long getPK(){  return data.id; } 
  void setPK(long long val){  data.id=val;} 
  void setPK(long long val){  data.id=val;} 
-unsigned  int  getId(){  return data.id; } 
- void setId(unsigned  int  val){  data.id=val;} 
+ unsigned  int  getId(){  return data.id; } 
+ void setId( unsigned  int  val){  data.id=val;} 
 
 
  int  getRandomnumber(){  return data.randomnumber; } 
  int  getRandomnumber(){  return data.randomnumber; } 
  void setRandomnumber( int  val){  data.randomnumber=val;} 
  void setRandomnumber( int  val){  data.randomnumber=val;} 

+ 1 - 1
frameworks/CSharp/fastendpoints/Benchmarks/Benchmarks.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
 <Project Sdk="Microsoft.NET.Sdk.Web">
 
 
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFramework>net8.0</TargetFramework>
+    <TargetFramework>net9.0</TargetFramework>
     <Nullable>enable</Nullable>
     <Nullable>enable</Nullable>
     <ImplicitUsings>enable</ImplicitUsings>
     <ImplicitUsings>enable</ImplicitUsings>
     <NoWarn>CA2016;IDE1006</NoWarn>
     <NoWarn>CA2016;IDE1006</NoWarn>

+ 3 - 2
frameworks/CSharp/fastendpoints/Benchmarks/Endpoints/JsonEndpoint.cs

@@ -1,6 +1,6 @@
 namespace Benchmarks.Endpoints;
 namespace Benchmarks.Endpoints;
 
 
-public sealed class JsonEndpoint : Endpoint<EmptyRequest, object>
+sealed class JsonEndpoint : Ep.NoReq.Res<object>
 {
 {
     public override void Configure()
     public override void Configure()
     {
     {
@@ -8,9 +8,10 @@ public sealed class JsonEndpoint : Endpoint<EmptyRequest, object>
         AllowAnonymous();
         AllowAnonymous();
     }
     }
 
 
-    public override Task HandleAsync(EmptyRequest _, CancellationToken __)
+    public override Task HandleAsync(CancellationToken ct)
     {
     {
         HttpContext.Response.ContentLength = 27;
         HttpContext.Response.ContentLength = 27;
+
         return SendAsync(new { message = "Hello, World!" });
         return SendAsync(new { message = "Hello, World!" });
     }
     }
 }
 }

+ 6 - 5
frameworks/CSharp/fastendpoints/Benchmarks/Endpoints/PlainTextEndpoint.cs

@@ -1,8 +1,8 @@
 namespace Benchmarks.Endpoints;
 namespace Benchmarks.Endpoints;
 
 
-public sealed class PlainTextEndpoint : Endpoint<EmptyRequest, EmptyResponse>
+sealed class PlainTextEndpoint : Ep.NoReq.Res<byte[]>
 {
 {
-    private static readonly byte[] payload = System.Text.Encoding.UTF8.GetBytes("Hello, World!");
+    static readonly byte[] _payload = "Hello, World!"u8.ToArray();
 
 
     public override void Configure()
     public override void Configure()
     {
     {
@@ -10,11 +10,12 @@ public sealed class PlainTextEndpoint : Endpoint<EmptyRequest, EmptyResponse>
         AllowAnonymous();
         AllowAnonymous();
     }
     }
 
 
-    public override Task HandleAsync(EmptyRequest _, CancellationToken __)
+    public override Task HandleAsync(CancellationToken ct)
     {
     {
         HttpContext.Response.StatusCode = StatusCodes.Status200OK;
         HttpContext.Response.StatusCode = StatusCodes.Status200OK;
         HttpContext.Response.ContentType = "text/plain";
         HttpContext.Response.ContentType = "text/plain";
-        HttpContext.Response.ContentLength = payload.Length;
-        return HttpContext.Response.Body.WriteAsync(payload, 0, payload.Length);
+        HttpContext.Response.ContentLength = _payload.Length;
+
+        return HttpContext.Response.Body.WriteAsync(_payload, 0, _payload.Length);
     }
     }
 }
 }

+ 5 - 5
frameworks/CSharp/fastendpoints/Benchmarks/Program.cs

@@ -1,9 +1,9 @@
 global using FastEndpoints;
 global using FastEndpoints;
 
 
-var builder = WebApplication.CreateBuilder();
-builder.Logging.ClearProviders();
-builder.Services.AddFastEndpoints();
+var bld = WebApplication.CreateBuilder();
+bld.Logging.ClearProviders();
+bld.Services.AddFastEndpoints();
 
 
-var app = builder.Build();
+var app = bld.Build();
 app.UseFastEndpoints();
 app.UseFastEndpoints();
-app.Run("http://0.0.0.0:8080");
+app.Run("http://0.0.0.0:8080");

+ 3 - 3
frameworks/CSharp/fastendpoints/README.md

@@ -5,11 +5,11 @@ This includes tests for plaintext and json serialization.
 
 
 **Language**
 **Language**
 
 
-* C# 12.0
+* C# 13.0
 
 
 **Platforms**
 **Platforms**
 
 
-* .NET 8 (Windows and Linux)
+* .NET 9 (Windows and Linux)
 
 
 **Web Servers**
 **Web Servers**
 
 
@@ -18,7 +18,7 @@ This includes tests for plaintext and json serialization.
 **Web Stack**
 **Web Stack**
 
 
 * [FastEndpoints](https://fast-endpoints.com/)
 * [FastEndpoints](https://fast-endpoints.com/)
-* ASP.NET 8
+* ASP.NET 9
 
 
 ## Paths & Source for Tests
 ## Paths & Source for Tests
 
 

+ 6 - 2
frameworks/CSharp/fastendpoints/fastendpoints.dockerfile

@@ -1,9 +1,13 @@
-FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
+FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
 WORKDIR /app
 WORKDIR /app
 COPY Benchmarks .
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out
 RUN dotnet publish -c Release -o out
 
 
-FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
+FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
+ENV DOTNET_GCDynamicAdaptationMode=0
+ENV DOTNET_ReadyToRun=0
+ENV DOTNET_HillClimbing_Disable=1
+
 WORKDIR /app
 WORKDIR /app
 COPY --from=build /app/out ./
 COPY --from=build /app/out ./
 
 

+ 7 - 8
frameworks/CSharp/genhttp/Benchmarks/Benchmarks.csproj

@@ -16,22 +16,21 @@
     </PropertyGroup>
     </PropertyGroup>
 
 
     <ItemGroup>
     <ItemGroup>
-        <None Remove="Resources\Fortunes.html"/>
-        <None Remove="Resources\Template.html"/>
+        <None Remove="Resources\Fortunes.html" />
+        <None Remove="Resources\Template.html" />
     </ItemGroup>
     </ItemGroup>
 
 
     <ItemGroup>
     <ItemGroup>
-        <EmbeddedResource Include="Resources\Template.html"/>
+        <EmbeddedResource Include="Resources\Template.html" />
     </ItemGroup>
     </ItemGroup>
 
 
     <ItemGroup>
     <ItemGroup>
 
 
-        <PackageReference Include="GenHTTP.Core.Kestrel" Version="9.0.0" />
-        <PackageReference Include="GenHTTP.Modules.Razor" Version="8.6.0" />
-        <PackageReference Include="GenHTTP.Modules.Webservices" Version="9.0.0" />
+        <PackageReference Include="GenHTTP.Core" Version="9.6.2" />
+        <PackageReference Include="GenHTTP.Modules.Webservices" Version="9.6.2" />
 
 
-        <PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
-        <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.0" />
+        <PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.1" />
+        <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.3" />
 
 
     </ItemGroup>
     </ItemGroup>
 
 

+ 4 - 2
frameworks/CSharp/genhttp/Benchmarks/Program.cs

@@ -1,14 +1,16 @@
 using Benchmarks.Tests;
 using Benchmarks.Tests;
 using Benchmarks.Utilities;
 using Benchmarks.Utilities;
-using GenHTTP.Engine.Kestrel;
+
+using GenHTTP.Engine.Internal;
+
 using GenHTTP.Modules.IO;
 using GenHTTP.Modules.IO;
 using GenHTTP.Modules.Layouting;
 using GenHTTP.Modules.Layouting;
 using GenHTTP.Modules.Webservices;
 using GenHTTP.Modules.Webservices;
 
 
 var tests = Layout.Create()
 var tests = Layout.Create()
                   .Add("plaintext", Content.From(Resource.FromString("Hello, World!")))
                   .Add("plaintext", Content.From(Resource.FromString("Hello, World!")))
+                  .Add("json", new JsonHandler())
                   .Add("fortunes", new FortuneHandler())
                   .Add("fortunes", new FortuneHandler())
-                  .AddService<JsonResource>("json")
                   .AddService<DbResource>("db")
                   .AddService<DbResource>("db")
                   .AddService<QueryResource>("queries")
                   .AddService<QueryResource>("queries")
                   .AddService<UpdateResource>("updates")
                   .AddService<UpdateResource>("updates")

+ 39 - 0
frameworks/CSharp/genhttp/Benchmarks/Tests/JsonHandler.cs

@@ -0,0 +1,39 @@
+using System.Text.Json;
+
+using GenHTTP.Api.Content;
+using GenHTTP.Api.Protocol;
+
+using GenHTTP.Modules.Conversion.Serializers.Json;
+
+namespace Benchmarks.Tests;
+
+public sealed class JsonResult
+{
+
+    public string Message { get; set; }
+}
+
+public sealed class JsonHandler : IHandler
+{
+    private static readonly FlexibleContentType _ContentType = new(ContentType.ApplicationJson, "utf-8");
+
+    private static readonly JsonSerializerOptions _Options = new();
+
+    public ValueTask PrepareAsync() => new();
+
+    public ValueTask<IResponse> HandleAsync(IRequest request)
+    {
+        var result = new JsonResult()
+        {
+            Message = "Hello, World!"
+        };
+
+        var response = request.Respond()
+                              .Content(new JsonContent(result, _Options))
+                              .Type(_ContentType)
+                              .Build();
+
+        return new(response);
+    }
+
+}

+ 0 - 20
frameworks/CSharp/genhttp/Benchmarks/Tests/JsonResource.cs

@@ -1,20 +0,0 @@
-using GenHTTP.Modules.Webservices;
-
-namespace Benchmarks.Tests;
-
-public sealed class JsonResult
-{
-
-    public string Message { get; set; }
-}
-
-public sealed class JsonResource
-{
-
-    [ResourceMethod]
-    public JsonResult GetMessage() => new()
-    {
-        Message = "Hello, World!"
-    };
-
-}

+ 5 - 0
frameworks/CSharp/genhttp/genhttp.dockerfile

@@ -11,6 +11,11 @@ RUN dotnet publish -c release -o /app -r linux-musl-x64 --no-restore --self-cont
 
 
 # final stage/image
 # final stage/image
 FROM mcr.microsoft.com/dotnet/runtime-deps:9.0-alpine
 FROM mcr.microsoft.com/dotnet/runtime-deps:9.0-alpine
+
+ENV DOTNET_GCDynamicAdaptationMode=0
+ENV DOTNET_ReadyToRun=0
+ENV DOTNET_HillClimbing_Disable=1
+
 WORKDIR /app
 WORKDIR /app
 COPY --from=build /app .
 COPY --from=build /app .
 
 

+ 2 - 4
frameworks/CSharp/sisk/benchmark_config.json

@@ -17,9 +17,7 @@
                 "os": "Linux",
                 "os": "Linux",
                 "database_os": "Linux",
                 "database_os": "Linux",
                 "display_name": "Sisk Framework"
                 "display_name": "Sisk Framework"
-            }
-        },
-        {
+            },
             "cadente": {
             "cadente": {
                 "plaintext_url": "/plaintext",
                 "plaintext_url": "/plaintext",
                 "json_url": "/json",
                 "json_url": "/json",
@@ -38,4 +36,4 @@
             }
             }
         }
         }
     ]
     ]
-}
+}

+ 1 - 1
frameworks/CSharp/sisk/config.toml

@@ -25,4 +25,4 @@ os = "Linux"
 orm = "Raw"
 orm = "Raw"
 platform = ".NET"
 platform = ".NET"
 webserver = "Cadente"
 webserver = "Cadente"
-versus = "None"
+versus = "None"

+ 7 - 3
frameworks/CSharp/sisk/sisk-cadente.dockerfile

@@ -1,4 +1,4 @@
-FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
+FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
 WORKDIR /source
 WORKDIR /source
 
 
 # copy csproj and restore as distinct layers
 # copy csproj and restore as distinct layers
@@ -7,10 +7,14 @@ RUN dotnet restore -r linux-musl-x64
 
 
 # copy and publish app and libraries
 # copy and publish app and libraries
 COPY sisk-cadente/ .
 COPY sisk-cadente/ .
-RUN dotnet publish -c release -o /app -r linux-musl-x64
+RUN dotnet publish -c release -o /app
+
+ENV DOTNET_GCDynamicAdaptationMode=0
+ENV DOTNET_ReadyToRun=0
+ENV DOTNET_HillClimbing_Disable=1
 
 
 # final stage/image
 # final stage/image
-FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
+FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
 WORKDIR /app
 WORKDIR /app
 COPY --from=build /app .
 COPY --from=build /app .
 
 

+ 22 - 14
frameworks/CSharp/sisk/sisk-cadente/Program.cs

@@ -1,10 +1,19 @@
-using System.Text;
+using System.Net;
+using System.Text;
 using System.Text.Json;
 using System.Text.Json;
 using Sisk.Cadente;
 using Sisk.Cadente;
 
 
-var host = new HttpHost ( 8080, session => {
-    var request = session.Request;
+HttpHost.QueueSize = 4096;
+
+var host = new HttpHost ( new IPEndPoint ( IPAddress.Any, 8080 ) );
+host.ContextCreated += Host_ContextCreated;
+
+host.Start ();
+Thread.Sleep ( Timeout.Infinite );
 
 
+void Host_ContextCreated ( HttpHost sender, HttpHostContext session ) {
+    var request = session.Request;
+    
     if (request.Path == "/plaintext") {
     if (request.Path == "/plaintext") {
         SerializePlainTextResponse ( session.Response );
         SerializePlainTextResponse ( session.Response );
     }
     }
@@ -14,23 +23,22 @@ var host = new HttpHost ( 8080, session => {
     else {
     else {
         session.Response.StatusCode = 404;
         session.Response.StatusCode = 404;
     }
     }
-} );
+}
 
 
-host.Start ();
-Thread.Sleep ( Timeout.Infinite );
+static void SerializePlainTextResponse ( HttpHostContext.HttpResponse response ) {
 
 
-static void SerializePlainTextResponse ( HttpResponse response ) {
-    var contentBytes = Encoding.UTF8.GetBytes ( "Hello, world!" );
+    var messageBytes = Encoding.UTF8.GetBytes ( "Hello, World!" );
 
 
-    response.Headers.Add ( new HttpHeader ( "Content-Type", "text/plain" ) );
-    response.ResponseStream = new MemoryStream ( contentBytes );
+    response.Headers.Add ( new HttpHeader ( "Content-Type", "text/plain; charset=UTF-8" ) );
+    response.ResponseStream = new MemoryStream ( messageBytes );
 }
 }
 
 
-static void SerializeJsonResponse ( HttpResponse response ) {
+static void SerializeJsonResponse ( HttpHostContext.HttpResponse response ) {
+
     var contentBytes = JsonSerializer.SerializeToUtf8Bytes ( new {
     var contentBytes = JsonSerializer.SerializeToUtf8Bytes ( new {
-        message = "Hello, world!"
+        message = "Hello, World!"
     } );
     } );
-
-    response.Headers.Add ( new HttpHeader ( "Content-Type", "application/json; charset=utf-8" ) );
+    
+    response.Headers.Add ( new HttpHeader ( "Content-Type", "application/json" ) );
     response.ResponseStream = new MemoryStream ( contentBytes );
     response.ResponseStream = new MemoryStream ( contentBytes );
 }
 }

+ 11 - 11
frameworks/CSharp/sisk/sisk-cadente/sisk.csproj

@@ -1,15 +1,15 @@
 <Project Sdk="Microsoft.NET.Sdk">
 <Project Sdk="Microsoft.NET.Sdk">
 
 
-	<PropertyGroup>
-		<OutputType>Exe</OutputType>
-		<TargetFramework>net8.0</TargetFramework>
-		<ImplicitUsings>enable</ImplicitUsings>
-		<Nullable>enable</Nullable>
-		<ServerGarbageCollection>true</ServerGarbageCollection>
-	</PropertyGroup>
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net9.0</TargetFramework>
+        <ImplicitUsings>enable</ImplicitUsings>
+        <Nullable>enable</Nullable>
+        <ServerGarbageCollection>true</ServerGarbageCollection>
+    </PropertyGroup>
 
 
-	<ItemGroup>
-	  <PackageReference Include="Sisk.Cadente" Version="0.1.42-alpha1" />
-	</ItemGroup>
+    <ItemGroup>
+        <PackageReference Include="Sisk.Cadente" Version="0.1.64-alpha4" />
+    </ItemGroup>
 
 
-</Project>
+</Project>

+ 6 - 2
frameworks/CSharp/sisk/sisk/Program.cs

@@ -1,9 +1,13 @@
 using System.Net.Http.Json;
 using System.Net.Http.Json;
+using System.Text;
 using Sisk.Core.Http;
 using Sisk.Core.Http;
 using Sisk.Core.Routing;
 using Sisk.Core.Routing;
 
 
 var app = HttpServer.CreateBuilder ( host => {
 var app = HttpServer.CreateBuilder ( host => {
     host.UseListeningPort ( "http://+:8080/" );
     host.UseListeningPort ( "http://+:8080/" );
+    host.UseConfiguration ( config => {
+        config.AccessLogsStream = null;
+    } );
 } ).Build ();
 } ).Build ();
 
 
 app.Router.SetRoute ( RouteMethod.Get, "/plaintext", PlainText );
 app.Router.SetRoute ( RouteMethod.Get, "/plaintext", PlainText );
@@ -12,11 +16,11 @@ app.Router.SetRoute ( RouteMethod.Get, "/json", Json );
 app.Start ();
 app.Start ();
 
 
 static HttpResponse PlainText ( HttpRequest request ) {
 static HttpResponse PlainText ( HttpRequest request ) {
-    return new HttpResponse ( "Hello, world!" );
+    return new HttpResponse ( new StringContent ( "Hello, World!", Encoding.UTF8, "text/plain" ) );
 }
 }
 
 
 static HttpResponse Json ( HttpRequest request ) {
 static HttpResponse Json ( HttpRequest request ) {
     return new HttpResponse ( JsonContent.Create ( new {
     return new HttpResponse ( JsonContent.Create ( new {
-        message = "Hello, world!"
+        message = "Hello, World!"
     } ) );
     } ) );
 }
 }

+ 5 - 5
frameworks/FSharp/falco/README.md

@@ -1,11 +1,12 @@
 # Falco Tests on Linux
 # Falco Tests on Linux
+
 This includes tests for plaintext, json, and fortunes HTML serialization.
 This includes tests for plaintext, json, and fortunes HTML serialization.
 
 
 ## Infrastructure Software Versions
 ## Infrastructure Software Versions
 
 
 **Language**
 **Language**
 
 
-* F# 6.0
+* F# 6.0 (or greater)
 
 
 **Platforms**
 **Platforms**
 
 
@@ -18,11 +19,10 @@ This includes tests for plaintext, json, and fortunes HTML serialization.
 **Web Stack**
 **Web Stack**
 
 
 * [Falco](https://github.com/pimbrouwers/Falco)
 * [Falco](https://github.com/pimbrouwers/Falco)
-* [Donald](https://github.com/pimbrouwers/Donald)
 * ASP.NET Core
 * ASP.NET Core
 
 
 ## Paths & Source for Tests
 ## Paths & Source for Tests
 
 
-* [Plaintext](src/App/Value.fs): "/plaintext"
-* [JSON serialization](src/App/Value.fs): "/json"
-* [Fortunes using Donald](src/App/Fortune.fs): "/fortunes"
+* [Plaintext](src/App/Program.fs): "/plaintext"
+* [JSON serialization](src/App/Program.fs): "/json"
+* [Fortunes using Donald](src/App/Program.fs): "/fortunes"

+ 1 - 1
frameworks/FSharp/falco/benchmark_config.json

@@ -18,7 +18,7 @@
         "webserver": "Kestrel",
         "webserver": "Kestrel",
         "os": "Linux",
         "os": "Linux",
         "database_os": "Linux",
         "database_os": "Linux",
-        "display_name": "Falco, Donald",
+        "display_name": "Falco",
         "notes": "",
         "notes": "",
         "versus": "aspcore"
         "versus": "aspcore"
       }
       }

+ 4 - 4
frameworks/FSharp/falco/falco.dockerfile

@@ -1,12 +1,12 @@
-FROM mcr.microsoft.com/dotnet/sdk:7.0.100 AS build
+FROM mcr.microsoft.com/dotnet/sdk:9.0.100 AS build
 WORKDIR /app
 WORKDIR /app
 COPY src/App .
 COPY src/App .
 RUN dotnet publish -c Release -o out
 RUN dotnet publish -c Release -o out
 
 
-FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime
+FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
 # Full PGO
 # Full PGO
-ENV DOTNET_TieredPGO 1 
-ENV DOTNET_TC_QuickJitForLoops 1 
+ENV DOTNET_TieredPGO 1
+ENV DOTNET_TC_QuickJitForLoops 1
 ENV DOTNET_ReadyToRun 0
 ENV DOTNET_ReadyToRun 0
 
 
 ENV ASPNETCORE_URLS http://+:8080
 ENV ASPNETCORE_URLS http://+:8080

+ 3 - 8
frameworks/FSharp/falco/src/App/App.fsproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
 <Project Sdk="Microsoft.NET.Sdk.Web">
 
 
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFramework>net9.0</TargetFramework>
     <DebugType>portable</DebugType>
     <DebugType>portable</DebugType>
     <AssemblyName>App</AssemblyName>
     <AssemblyName>App</AssemblyName>
     <OutputType>Exe</OutputType>
     <OutputType>Exe</OutputType>
@@ -11,17 +11,12 @@
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <Compile Include="UI.fs" />
-    <Compile Include="Fortune.fs" />
-    <Compile Include="Server.fs" />
     <Compile Include="Program.fs" />
     <Compile Include="Program.fs" />
   </ItemGroup>
   </ItemGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Update="FSharp.Core" Version="7.0.0" />
-    <PackageReference Include="Donald" Version="3.0.*" />
-    <PackageReference Include="Falco" Version="2.0.*" />
-    <PackageReference Include="Npgsql" Version="8.0.3" />
+    <PackageReference Include="Falco" Version="5.*" />
+    <PackageReference Include="Npgsql" Version="9.*" />
   </ItemGroup>
   </ItemGroup>
 
 
 </Project>
 </Project>

+ 0 - 83
frameworks/FSharp/falco/src/App/Fortune.fs

@@ -1,83 +0,0 @@
-module App.Fortune    
-
-open System.Data
-open System.Threading.Tasks     
-open Donald
-open Falco
- 
-type FortuneModel = 
-   {
-       id      : int
-       message : string
-   }
-
-module FortuneModel =
-   let fromDataReader (rd : IDataReader) =
-       {
-           id = rd.GetInt32("id")
-           message = rd.GetString("message")
-       }
-
-module Service = 
-    module ListQuery =              
-        type LoadFortunes = unit -> Task<FortuneModel list>
-
-        let extraFortune = 
-            {
-                id = 0
-                message = "Additional fortune added at request time."
-            }
-
-        let handle
-            (loadFortunes : LoadFortunes) =
-            fun () -> 
-                task {
-                    let! fortunes = loadFortunes ()
-                    
-                    return 
-                        extraFortune 
-                        :: fortunes
-                        |> List.sortBy (fun f -> f.message)
-                }
-
-
-module Db =    
-    let selectAsync (connection : IDbConnection) : Task<FortuneModel list> =        
-        queryAsync 
-            "SELECT id, message FROM fortune"
-            []
-            FortuneModel.fromDataReader
-            connection
-
-module View =
-    open Falco.Markup
-    
-    let index (fortunes : FortuneModel list) =            
-        UI.layout "Fortunes" [
-                Elem.table [] [
-                        yield Elem.tr [] [
-                                Elem.th [] [ Text.raw "id" ]
-                                Elem.th [] [ Text.raw "message" ]
-                            ]
-                        for fortune in fortunes ->
-                            Elem.tr [] [
-                                    Elem.td [] [ Text.raw (string fortune.id) ]
-                                    Elem.td [] [ Text.enc fortune.message]
-                                ]
-                    ]
-            ]
-
-let handleIndex : HttpHandler =        
-    fun ctx ->
-        task {
-            let connFactory = ctx.GetService<DbConnectionFactory>()
-            use conn = createConn connFactory
-            let selectFortunes = fun () -> Db.selectAsync conn
-            let! fortunes = () |> Service.ListQuery.handle selectFortunes
-
-            return!
-                ctx
-                |> (fortunes 
-                    |> View.index 
-                    |> Response.ofHtml)                    
-        } :> Task

+ 86 - 11
frameworks/FSharp/falco/src/App/Program.fs

@@ -1,7 +1,12 @@
 module Program
 module Program
 
 
+open System.Data
 open Falco
 open Falco
-open App
+open Falco.Markup
+open Falco.Routing
+open Microsoft.AspNetCore.Builder
+open Microsoft.Extensions.Logging
+open Npgsql
 
 
 [<Literal>]
 [<Literal>]
 let connectionString = "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;SSL Mode=Disable;Maximum Pool Size=1024;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Buffer Threshold Bytes=1000"
 let connectionString = "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;SSL Mode=Disable;Maximum Pool Size=1024;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Buffer Threshold Bytes=1000"
@@ -9,16 +14,86 @@ let connectionString = "Server=tfb-database;Database=hello_world;User Id=benchma
 [<Literal>]
 [<Literal>]
 let defaultMsg = "Hello, World!"
 let defaultMsg = "Hello, World!"
 
 
-type JsonModel = { message : string }
+type JsonResponse =
+    { message : string }
+
+type Fortune =
+    { id : int
+      message : string }
+
+    static member Default =
+        { id = 0
+          message = "Additional fortune added at request time." }
+
+let handleFortunes (connStr : string) : HttpHandler = fun ctx -> task {
+    use conn = new NpgsqlConnection(connStr)
+
+    use comd = conn.CreateCommand()
+    comd.CommandText <- "SELECT id, message FROM fortune"
+
+    do! conn.OpenAsync()
+    use! redr = comd.ExecuteReaderAsync(CommandBehavior.SequentialAccess)
+
+    let! dbFortunes =
+        task {
+            let mutable shouldContinue = true
+            let fortunes = ResizeArray<Fortune>()
+
+            while shouldContinue do
+                let! fortunesRead = redr.ReadAsync()
+
+                if not fortunesRead then
+                    shouldContinue <- false
+                else
+                    fortunes.Add { id = redr.GetInt32(0)
+                                   message = redr.GetString(1) }
+            return fortunes |> List.ofSeq
+        }
+
+    redr.Dispose()
+    comd.Dispose()
+    conn.Dispose()
+
+    let sortedFortunes =
+        Fortune.Default ::
+        dbFortunes
+        |> List.sortBy (fun f -> f.message)
+
+    let html =
+        Elem.html [] [
+            Elem.head [] [
+                    Elem.title [] [ Text.raw "Fortunes" ]
+                ]
+            Elem.body [] [
+                Elem.table [] [
+                        yield Elem.tr [] [
+                                Elem.th [] [ Text.raw "id" ]
+                                Elem.th [] [ Text.raw "message" ]
+                            ]
+                        for fortune in sortedFortunes ->
+                            Elem.tr [] [
+                                    Elem.td [] [ Text.raw (string fortune.id) ]
+                                    Elem.td [] [ Text.enc fortune.message]
+                                ]
+                    ]
+            ]
+        ]
+
+    return Response.ofHtml html ctx
+}
 
 
 [<EntryPoint>]
 [<EntryPoint>]
-let main args =        
-    Host.startWebHost 
-        args        
-        (Server.configure connectionString)
-        [
-            get "/plaintext"  (Response.ofPlainText defaultMsg)
-            get "/json"       (Response.ofJson { message = defaultMsg })
-            get "/fortunes"   Fortune.handleIndex
-        ]    
+let main args =
+    let bldr  = WebApplication.CreateBuilder(args)
+    bldr.Logging.ClearProviders() |> ignore
+
+    let wapp = bldr.Build()
+
+    wapp.UseRouting()
+        .UseFalco([
+            get "/plaintext" (Response.ofPlainText defaultMsg)
+            get "/json" (Response.ofJson { message = defaultMsg })
+            get "/fortunes" (handleFortunes connectionString)
+        ])
+        .Run()
     0
     0

+ 0 - 47
frameworks/FSharp/falco/src/App/Server.fs

@@ -1,47 +0,0 @@
-module App.Server
-
-open System.Data
-open Donald
-open Falco
-open Falco.Host
-open Microsoft.AspNetCore.Builder
-open Microsoft.AspNetCore.Hosting
-open Microsoft.Extensions.DependencyInjection
-open Microsoft.Extensions.Logging
-open Npgsql
-
-type ConnectionString = string
-type ConfigureLogging = ILoggingBuilder -> unit
-type ConfigureServices = DbConnectionFactory -> IServiceCollection -> unit
-type ConfigureApp = HttpEndpoint list -> IApplicationBuilder -> unit
-type ConfigureServer = ConnectionString -> ConfigureWebHost
-
-let configure : ConfigureServer =
-    let configureLogging : ConfigureLogging =
-        fun log ->
-            log.ClearProviders()
-            |> ignore
-
-    let configureServices : ConfigureServices =
-        fun connectionFactory services ->
-            services
-                .AddRouting() 
-                .AddSingleton<DbConnectionFactory>(connectionFactory)
-            |> ignore
-
-    let configure : ConfigureApp =         
-        fun endpoints app ->
-            app.UseRouting()
-               .UseHttpEndPoints(endpoints)       
-               |> ignore 
-
-    fun connectionString endpoints webHost ->    
-        let connectionFactory =     
-            fun () -> new NpgsqlConnection(connectionString) :> IDbConnection
-    
-        webHost
-            .UseKestrel()
-            .ConfigureLogging(configureLogging)
-            .ConfigureServices(configureServices connectionFactory)
-            .Configure(configure endpoints)
-            |> ignore

+ 0 - 11
frameworks/FSharp/falco/src/App/UI.fs

@@ -1,11 +0,0 @@
-module App.UI
-
-open Falco.Markup
-    
-let layout pageTitle content = 
-    Elem.html [] [
-        Elem.head [] [                
-                Elem.title [] [ Text.raw pageTitle ]                                                                
-            ]
-        Elem.body [] content
-    ] 

+ 78 - 0
frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientConnection.java

@@ -0,0 +1,78 @@
+
+package io.helidon.benchmark.nima.models;
+
+import io.vertx.pgclient.PgConnection;
+import io.vertx.sqlclient.PreparedQuery;
+import io.vertx.sqlclient.Row;
+import io.vertx.sqlclient.RowSet;
+
+public class PgClientConnection implements AutoCloseable {
+    static final int UPDATE_QUERIES = 500;
+    private static String SELECT_WORLD = "SELECT id, randomnumber from WORLD where id=$1";
+    private static String SELECT_FORTUNE = "SELECT * from FORTUNE";
+
+    private PreparedQuery<RowSet<Row>> worldQuery;
+    private PreparedQuery<RowSet<Row>> fortuneQuery;
+    private PreparedQuery<RowSet<Row>>[] updateQuery;
+
+    private final PgConnection conn;
+
+    PgClientConnection(PgConnection conn) {
+        this.conn = conn;
+    }
+
+    public PgConnection pgConnection() {
+        return conn;
+    }
+
+    @Override
+    public void close() {
+        conn.close();
+    }
+
+    public PreparedQuery<RowSet<Row>> worldQuery() {
+        return worldQuery;
+    }
+
+    public PreparedQuery<RowSet<Row>> fortuneQuery() {
+        return fortuneQuery;
+    }
+
+    public PreparedQuery<RowSet<Row>> updateQuery(int queryCount) {
+        return updateQuery[queryCount - 1];
+    }
+
+    @SuppressWarnings("unchecked")
+    void prepare() {
+        try {
+            worldQuery = conn.prepare(SELECT_WORLD)
+                    .toCompletionStage().toCompletableFuture().get().query();
+            fortuneQuery = conn.prepare(SELECT_FORTUNE)
+                    .toCompletionStage().toCompletableFuture().get().query();
+            updateQuery = (PreparedQuery<RowSet<Row>>[]) new PreparedQuery<?>[UPDATE_QUERIES];
+            for (int i = 0; i < UPDATE_QUERIES; i++) {
+                updateQuery[i] = conn.prepare(singleUpdate(i + 1))
+                        .toCompletionStage().toCompletableFuture().get().query();
+            }
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    private static String singleUpdate(int count) {
+        StringBuilder sql = new StringBuilder();
+        sql.append("UPDATE WORLD SET RANDOMNUMBER = CASE ID");
+        for (int i = 0; i < count; i++) {
+            int k = i * 2 + 1;
+            sql.append(" WHEN $").append(k).append(" THEN $").append(k + 1);
+        }
+        sql.append(" ELSE RANDOMNUMBER");
+        sql.append(" END WHERE ID IN ($1");
+        for (int i = 1; i < count; i++) {
+            int k = i * 2 + 1;
+            sql.append(",$").append(k);
+        }
+        sql.append(")");
+        return sql.toString();
+    }
+}

+ 11 - 116
frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientConnectionPool.java

@@ -1,59 +1,30 @@
 
 
 package io.helidon.benchmark.nima.models;
 package io.helidon.benchmark.nima.models;
 
 
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.locks.ReentrantLock;
-
+import io.helidon.config.Config;
 import io.vertx.core.Vertx;
 import io.vertx.core.Vertx;
 import io.vertx.pgclient.PgConnectOptions;
 import io.vertx.pgclient.PgConnectOptions;
 import io.vertx.pgclient.PgConnection;
 import io.vertx.pgclient.PgConnection;
-import io.vertx.sqlclient.PreparedQuery;
-import io.vertx.sqlclient.Row;
-import io.vertx.sqlclient.RowSet;
 
 
-class PgClientConnectionPool implements AutoCloseable {
+abstract class PgClientConnectionPool implements AutoCloseable {
 
 
+    private final Config config;
     private final Vertx vertx;
     private final Vertx vertx;
     private final PgConnectOptions options;
     private final PgConnectOptions options;
-    private final ReentrantLock lock = new ReentrantLock();
-    private final Map<String, PgClientConnection> connectionMap = new HashMap<>();
 
 
-    public PgClientConnectionPool(Vertx vertx, PgConnectOptions options) {
+    static PgClientConnectionPool create(Vertx vertx, PgConnectOptions options, Config config) {
+        return new PgClientConnectionPoolArray(vertx, options, config);
+    }
+
+    PgClientConnectionPool(Vertx vertx, PgConnectOptions options, Config config) {
         this.vertx = vertx;
         this.vertx = vertx;
         this.options = options;
         this.options = options;
+        this.config = config;
     }
     }
 
 
-    public PgClientConnection clientConnection() {
-        String carrierThread = carrierThread();
-        PgClientConnection connection = connectionMap.get(carrierThread);
-        if (connection == null) {
-            try {
-                lock.lock();
-                connection = connectionMap.get(carrierThread);
-                if (connection == null) {
-                    connection = newConnection();
-                    connectionMap.put(carrierThread, connection);
-                }
-            } finally {
-                lock.unlock();
-            }
-        }
-        return connection;
-    }
+    abstract PgClientConnection clientConnection();
 
 
-    @Override
-    public void close() {
-        try {
-            for (PgClientConnection connection : connectionMap.values()) {
-                connection.close();
-            }
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    private PgClientConnection newConnection() {
+    protected PgClientConnection newConnection() {
         try {
         try {
             PgConnection conn = PgConnection.connect(vertx, options)
             PgConnection conn = PgConnection.connect(vertx, options)
                     .toCompletionStage().toCompletableFuture().get();
                     .toCompletionStage().toCompletableFuture().get();
@@ -64,80 +35,4 @@ class PgClientConnectionPool implements AutoCloseable {
             throw new RuntimeException(e);
             throw new RuntimeException(e);
         }
         }
     }
     }
-
-    static String carrierThread() {
-        String threadName = Thread.currentThread().toString();
-        return threadName.substring(threadName.indexOf('@') + 1);
-    }
-
-    public static class PgClientConnection implements AutoCloseable {
-        static final int UPDATE_QUERIES = 500;
-        private static String SELECT_WORLD = "SELECT id, randomnumber from WORLD where id=$1";
-        private static String SELECT_FORTUNE = "SELECT * from FORTUNE";
-
-        private PreparedQuery<RowSet<Row>> worldQuery;
-        private PreparedQuery<RowSet<Row>> fortuneQuery;
-        private PreparedQuery<RowSet<Row>>[] updateQuery;
-
-        private final PgConnection conn;
-
-        PgClientConnection(PgConnection conn) {
-            this.conn = conn;
-        }
-
-        public PgConnection pgConnection() {
-            return conn;
-        }
-
-        @Override
-        public void close() {
-            conn.close();
-        }
-
-        public PreparedQuery<RowSet<Row>> worldQuery() {
-            return worldQuery;
-        }
-
-        public PreparedQuery<RowSet<Row>> fortuneQuery() {
-            return fortuneQuery;
-        }
-
-        public PreparedQuery<RowSet<Row>> updateQuery(int queryCount) {
-            return updateQuery[queryCount - 1];
-        }
-
-        @SuppressWarnings("unchecked")
-        void prepare() {
-            try {
-                worldQuery = conn.prepare(SELECT_WORLD)
-                        .toCompletionStage().toCompletableFuture().get().query();
-                fortuneQuery = conn.prepare(SELECT_FORTUNE)
-                        .toCompletionStage().toCompletableFuture().get().query();
-                updateQuery = (PreparedQuery<RowSet<Row>>[]) new PreparedQuery<?>[UPDATE_QUERIES];
-                for (int i = 0; i < UPDATE_QUERIES; i++) {
-                    updateQuery[i] = conn.prepare(singleUpdate(i + 1))
-                            .toCompletionStage().toCompletableFuture().get().query();
-                }
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        private static String singleUpdate(int count) {
-            StringBuilder sql = new StringBuilder();
-            sql.append("UPDATE WORLD SET RANDOMNUMBER = CASE ID");
-            for (int i = 0; i < count; i++) {
-                int k = i * 2 + 1;
-                sql.append(" WHEN $").append(k).append(" THEN $").append(k + 1);
-            }
-            sql.append(" ELSE RANDOMNUMBER");
-            sql.append(" END WHERE ID IN ($1");
-            for (int i = 1; i < count; i++) {
-                int k = i * 2 + 1;
-                sql.append(",$").append(k);
-            }
-            sql.append(")");
-            return sql.toString();
-        }
-    }
 }
 }

+ 60 - 0
frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientConnectionPoolArray.java

@@ -0,0 +1,60 @@
+
+package io.helidon.benchmark.nima.models;
+
+import java.util.concurrent.locks.ReentrantLock;
+import java.util.logging.Logger;
+
+import io.helidon.config.Config;
+import io.vertx.core.Vertx;
+import io.vertx.pgclient.PgConnectOptions;
+
+class PgClientConnectionPoolArray extends PgClientConnectionPool {
+    private static final Logger LOGGER = Logger.getLogger(PgClientConnectionPoolArray.class.getName());
+
+    private final int connections;
+    private final PgClientConnection[] connectionArray;
+    private final ReentrantLock lock = new ReentrantLock();
+
+    PgClientConnectionPoolArray(Vertx vertx, PgConnectOptions options, Config config) {
+        super(vertx, options, config);
+        double sizeFactor = config.get("pgclient-connection-pool.size-factor")
+                .asDouble()
+                .orElse(1.0);
+        connections = (int) (Runtime.getRuntime().availableProcessors() * sizeFactor);
+        connectionArray = new PgClientConnection[connections];
+        LOGGER.info("Connection pool is " + getClass().getSimpleName());
+        LOGGER.info("Size of connection pool is " + connections);
+    }
+
+    @Override
+    public PgClientConnection clientConnection() {
+        int index = Thread.currentThread().hashCode() % connections;
+        PgClientConnection connection = connectionArray[index];
+        if (connection == null) {
+            try {
+                lock.lock();
+                connection = connectionArray[index];
+                if (connection == null) {
+                    connection = newConnection();
+                    connectionArray[index] = connection;
+                }
+            } finally {
+                lock.unlock();
+            }
+        }
+        return connection;
+    }
+
+    @Override
+    public void close() {
+        try {
+            for (PgClientConnection connection : connectionArray) {
+                if (connection != null) {
+                    connection.close();
+                }
+            }
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+}

+ 2 - 5
frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientRepository.java

@@ -2,7 +2,6 @@ package io.helidon.benchmark.nima.models;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
-import java.util.logging.Logger;
 
 
 import io.helidon.config.Config;
 import io.helidon.config.Config;
 import io.vertx.core.Future;
 import io.vertx.core.Future;
@@ -15,14 +14,12 @@ import io.vertx.sqlclient.RowSet;
 import io.vertx.sqlclient.Tuple;
 import io.vertx.sqlclient.Tuple;
 
 
 import static io.helidon.benchmark.nima.models.DbRepository.randomWorldNumber;
 import static io.helidon.benchmark.nima.models.DbRepository.randomWorldNumber;
-import static io.helidon.benchmark.nima.models.PgClientConnectionPool.PgClientConnection.UPDATE_QUERIES;
+import static io.helidon.benchmark.nima.models.PgClientConnection.UPDATE_QUERIES;
 
 
 public class PgClientRepository implements DbRepository {
 public class PgClientRepository implements DbRepository {
-    private static final Logger LOGGER = Logger.getLogger(PgClientRepository.class.getName());
 
 
     private final PgClientConnectionPool connectionPool;
     private final PgClientConnectionPool connectionPool;
 
 
-    @SuppressWarnings("unchecked")
     public PgClientRepository(Config config) {
     public PgClientRepository(Config config) {
         VertxOptions vertxOptions = new VertxOptions()
         VertxOptions vertxOptions = new VertxOptions()
                 .setPreferNativeTransport(true)
                 .setPreferNativeTransport(true)
@@ -41,7 +38,7 @@ public class PgClientRepository implements DbRepository {
                 .setTcpQuickAck(true)
                 .setTcpQuickAck(true)
                 .setTcpKeepAlive(true)
                 .setTcpKeepAlive(true)
                 .setPipeliningLimit(100000);
                 .setPipeliningLimit(100000);
-        connectionPool = new PgClientConnectionPool(vertx, connectOptions);
+        connectionPool = PgClientConnectionPool.create(vertx, connectOptions, config);
     }
     }
 
 
     @Override
     @Override

+ 2 - 0
frameworks/Java/helidon/nima/src/main/resources/application.yaml

@@ -37,4 +37,6 @@ db: "hello_world"
 username: benchmarkdbuser
 username: benchmarkdbuser
 password: benchmarkdbpass
 password: benchmarkdbpass
 db-repository: "pgclient"     # "pgclient" (default) or "hikari"
 db-repository: "pgclient"     # "pgclient" (default) or "hikari"
+pgclient-connection-pool:
+  size-factor: 1.0            # size = available-processors * size-factor
 
 

+ 1 - 1
frameworks/Java/inverno/inverno-postgres.dockerfile

@@ -2,7 +2,7 @@ FROM maven:3.9.9-eclipse-temurin-21 as maven
 WORKDIR /inverno
 WORKDIR /inverno
 COPY src src
 COPY src src
 COPY pom.xml pom.xml
 COPY pom.xml pom.xml
-RUN mvn package -q -Pio.inverno.io_uring
+RUN mvn package -q -Pio.inverno.epoll
 
 
 EXPOSE 8080
 EXPOSE 8080
 
 

+ 1 - 1
frameworks/Java/inverno/inverno.dockerfile

@@ -2,7 +2,7 @@ FROM maven:3.9.9-eclipse-temurin-21 as maven
 WORKDIR /inverno
 WORKDIR /inverno
 COPY src src
 COPY src src
 COPY pom.xml pom.xml
 COPY pom.xml pom.xml
-RUN mvn package -q -Pio.inverno.io_uring
+RUN mvn package -q -Pio.inverno.epoll
 
 
 EXPOSE 8080
 EXPOSE 8080
 
 

+ 3 - 3
frameworks/Java/smart-socket/benchmark_config.json

@@ -1,5 +1,5 @@
 {
 {
-  "framework": "smart-socket",
+  "framework": "feat",
   "tests": [
   "tests": [
     {
     {
       "default": {
       "default": {
@@ -17,9 +17,9 @@
         "webserver": "None",
         "webserver": "None",
         "os": "Linux",
         "os": "Linux",
         "database_os": "Linux",
         "database_os": "Linux",
-        "display_name": "smart-socket",
+        "display_name": "feat",
         "notes": "",
         "notes": "",
-        "versus": "smart-socket"
+        "versus": "feat"
       },
       },
       "smart-servlet": {
       "smart-servlet": {
         "json_url": "/json",
         "json_url": "/json",

+ 2 - 2
frameworks/Java/smart-socket/smart-socket-smart-servlet.dockerfile → frameworks/Java/smart-socket/feat-smart-servlet.dockerfile

@@ -2,11 +2,11 @@ FROM maven:3.9.7-amazoncorretto-21 as maven
 WORKDIR /smart-socket
 WORKDIR /smart-socket
 COPY pom.xml pom.xml
 COPY pom.xml pom.xml
 COPY src src
 COPY src src
-RUN mvn compile assembly:single -q
+RUN mvn install -q
 
 
 FROM openjdk:21-jdk-slim
 FROM openjdk:21-jdk-slim
 WORKDIR /smart-socket
 WORKDIR /smart-socket
-COPY --from=maven /smart-socket/target/smart-socket-benchmark-1.0-jar-with-dependencies.jar app.jar
+COPY --from=maven /smart-socket/target/smart-socket-benchmark-1.0.jar app.jar
 
 
 EXPOSE 8080
 EXPOSE 8080
 
 

+ 2 - 2
frameworks/Java/smart-socket/smart-socket.dockerfile → frameworks/Java/smart-socket/feat.dockerfile

@@ -2,11 +2,11 @@ FROM maven:3.9.7-amazoncorretto-21 as maven
 WORKDIR /smart-socket
 WORKDIR /smart-socket
 COPY pom.xml pom.xml
 COPY pom.xml pom.xml
 COPY src src
 COPY src src
-RUN mvn compile assembly:single -q
+RUN mvn install -q
 
 
 FROM openjdk:21-jdk-slim
 FROM openjdk:21-jdk-slim
 WORKDIR /smart-socket
 WORKDIR /smart-socket
-COPY --from=maven /smart-socket/target/smart-socket-benchmark-1.0-jar-with-dependencies.jar app.jar
+COPY --from=maven /smart-socket/target/smart-socket-benchmark-1.0.jar app.jar
 
 
 EXPOSE 8080
 EXPOSE 8080
 
 

+ 24 - 9
frameworks/Java/smart-socket/pom.xml

@@ -17,6 +17,11 @@
     </properties>
     </properties>
 
 
     <dependencies>
     <dependencies>
+        <dependency>
+            <groupId>tech.smartboot.feat</groupId>
+            <artifactId>feat-restful</artifactId>
+            <version>0.5</version>
+        </dependency>
         <dependency>
         <dependency>
             <groupId>io.edap</groupId>
             <groupId>io.edap</groupId>
             <artifactId>edapx-json</artifactId>
             <artifactId>edapx-json</artifactId>
@@ -26,6 +31,12 @@
             <groupId>tech.smartboot.servlet</groupId>
             <groupId>tech.smartboot.servlet</groupId>
             <artifactId>servlet-core</artifactId>
             <artifactId>servlet-core</artifactId>
             <version>${smartservlet.version}</version>
             <version>${smartservlet.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>tech.smartboot.feat</groupId>
+                    <artifactId>feat-restful</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         </dependency>
         <dependency>
         <dependency>
             <groupId>com.zaxxer</groupId>
             <groupId>com.zaxxer</groupId>
@@ -114,20 +125,24 @@
             </plugin>
             </plugin>
 
 
             <plugin>
             <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <version>3.1.0</version>
-                <configuration>
-                    <descriptorRefs>
-                        <descriptorRef>jar-with-dependencies</descriptorRef>
-                    </descriptorRefs>
-                </configuration>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>3.3.0</version>
                 <executions>
                 <executions>
                     <execution>
                     <execution>
-                        <id>make-assembly</id>
                         <phase>package</phase>
                         <phase>package</phase>
                         <goals>
                         <goals>
-                            <goal>single</goal>
+                            <goal>shade</goal>
                         </goals>
                         </goals>
+                        <configuration>
+                            <createDependencyReducedPom>false</createDependencyReducedPom>
+                            <transformers>
+                                <!-- 采用追加的方式 -->
+                                <transformer
+                                        implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
+                                    <resource>META-INF/services/tech.smartboot.feat.core.apt.AptLoader</resource>
+                                </transformer>
+                            </transformers>
+                        </configuration>
                     </execution>
                     </execution>
                 </executions>
                 </executions>
             </plugin>
             </plugin>

+ 18 - 17
frameworks/Java/smart-socket/src/main/java/org/smartboot/http/Bootstrap.java

@@ -8,12 +8,7 @@
 
 
 package org.smartboot.http;
 package org.smartboot.http;
 
 
-import org.smartboot.Message;
-import tech.smartboot.feat.core.Feat;
-import tech.smartboot.feat.core.common.enums.HeaderValueEnum;
-import tech.smartboot.feat.core.server.HttpHandler;
-import tech.smartboot.feat.core.server.HttpRequest;
-import tech.smartboot.feat.core.server.HttpResponse;
+import tech.smartboot.feat.restful.RestFeat;
 
 
 public class Bootstrap {
 public class Bootstrap {
     static byte[] body = "Hello, World!".getBytes();
     static byte[] body = "Hello, World!".getBytes();
@@ -21,21 +16,27 @@ public class Bootstrap {
     public static void main(String[] args) {
     public static void main(String[] args) {
         int cpuNum = Runtime.getRuntime().availableProcessors();
         int cpuNum = Runtime.getRuntime().availableProcessors();
         // 定义服务器接受的消息类型以及各类消息对应的处理器
         // 定义服务器接受的消息类型以及各类消息对应的处理器
-        Feat.createHttpServer(options -> {
+//        Feat.createHttpServer(options -> {
+//            options.threadNum(cpuNum + 1)
+//                    .headerLimiter(0)
+//                    .readBufferSize(1024 * 4)
+//                    .writeBufferSize(1024 * 4);
+//        }).httpHandler(request -> {
+//            HttpResponse response = request.getResponse();
+//            if ("/plaintext".equals(request.getRequestURI())) {
+//                response.setContentLength(body.length);
+//                response.setContentType(HeaderValueEnum.ContentType.TEXT_PLAIN_UTF8);
+//                response.write(body);
+//            } else if ("/json".equals(request.getRequestURI())) {
+//                response.setContentType("application/json");
+//                JsonUtil.writeJsonBytes(response, new Message("Hello, World!"));
+//            }
+//        }).listen(8080);
+        RestFeat.createServer(options -> {
             options.threadNum(cpuNum + 1)
             options.threadNum(cpuNum + 1)
                     .headerLimiter(0)
                     .headerLimiter(0)
                     .readBufferSize(1024 * 4)
                     .readBufferSize(1024 * 4)
                     .writeBufferSize(1024 * 4);
                     .writeBufferSize(1024 * 4);
-        }).httpHandler(request -> {
-            HttpResponse response = request.getResponse();
-            if ("/plaintext".equals(request.getRequestURI())) {
-                response.setContentLength(body.length);
-                response.setContentType(HeaderValueEnum.ContentType.TEXT_PLAIN_UTF8);
-                response.write(body);
-            } else if ("/json".equals(request.getRequestURI())) {
-                response.setContentType("application/json");
-                JsonUtil.writeJsonBytes(response, new Message("Hello, World!"));
-            }
         }).listen(8080);
         }).listen(8080);
     }
     }
 
 

+ 24 - 0
frameworks/Java/smart-socket/src/main/java/org/smartboot/http/FeatController.java

@@ -0,0 +1,24 @@
+package org.smartboot.http;
+
+import org.smartboot.Message;
+import tech.smartboot.feat.core.apt.annotation.Controller;
+import tech.smartboot.feat.core.apt.annotation.RequestMapping;
+import tech.smartboot.feat.core.common.enums.HeaderValueEnum;
+import tech.smartboot.feat.core.server.HttpResponse;
+
+@Controller
+public class FeatController {
+    static byte[] body = "Hello, World!".getBytes();
+
+    @RequestMapping("/plaintext")
+    public byte[] plaintext(HttpResponse response) {
+        response.setContentType(HeaderValueEnum.ContentType.TEXT_PLAIN_UTF8);
+        return body;
+    }
+
+    @RequestMapping("/json")
+    public Message json(HttpResponse response) {
+        response.setContentType(HeaderValueEnum.ContentType.APPLICATION_JSON_UTF8);
+        return new Message("Hello, World!");
+    }
+}

+ 19 - 0
frameworks/Java/tio-boot/.dockerignore

@@ -0,0 +1,19 @@
+.github
+.git
+.DS_Store
+docs
+kubernetes
+node_modules
+/.svelte-kit
+/package
+.env
+.env.*
+vite.config.js.timestamp-*
+vite.config.ts.timestamp-*
+__pycache__
+.env
+_old
+uploads
+.ipynb_checkpoints
+**/*.db
+_test

+ 3 - 0
frameworks/Java/tio-boot/.gitignore

@@ -0,0 +1,3 @@
+/target/
+logs
+.settings

+ 114 - 0
frameworks/Java/tio-boot/README.md

@@ -0,0 +1,114 @@
+# t-io Benchmarking Test
+
+This is the tio-server portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
+
+## Controller
+
+These implementations use the tio-server's controller.
+
+### Plaintext Test
+
+* [Plaintext test source](src/main/java/com/litongjava/tio/http/server/controller/IndexController.java)
+
+### JSON Serialization Test
+
+* [JSON test source](src/main/java/com/litongjava/tio/http/server/controller/IndexController.java)
+
+### Database Query Test
+
+* [Database Query test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java))
+
+### Database Queries Test
+
+* [Database Queries test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java))
+
+### Database Update Test
+
+* [Database Update test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java))
+
+### Template rendering Test
+
+* [Template rendering test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java))
+
+### Cache Query Test
+* [Cache query test source](src/main/java/com/litongjava/tio/http/server/controller/CacheController.java))
+
+
+## Versions
+3.7.3.v20231218-RELEASE (https://gitee.com/litongjava/t-io)
+
+## Test URLs
+
+All implementations use the same URLs.
+
+### Plaintext Test
+
+    http://localhost:8080/plaintext
+
+### JSON Encoding Test
+
+    http://localhost:8080/json
+
+### Database Query Test
+
+    http://localhost:8080/db
+
+### Database Queries Test
+
+    http://localhost:8080/queries?queries=5
+
+### Cache Query Test
+
+    http://localhost:8080/cacheQuery?queries=10000
+
+### Template rendering Test
+
+    http://localhost:8080/fortunes
+    
+### Database Update Test
+
+    http://localhost:8080/updates?queries=5
+
+ ## Hot to run
+ ### install mysql 8
+ - 1.please instal mysql 8.0.32,example cmd
+ ```
+ docker run --restart=always -d --name mysql_8 --hostname mysql \
+-p 3306:3306 \
+-e 'MYSQL_ROOT_PASSWORD=robot_123456#' -e 'MYSQL_ROOT_HOST=%' -e 'MYSQL_DATABASE=hello_world' \
+mysql/mysql-server:8.0.32 \
+--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --lower_case_table_names=1
+ ```
+ - 2.create database schema hello_world
+ - 3.create tablle,[example](sql/hello_world.sql)
+ - 4.import data
+ 
+ ### docker 
+ ```
+ docker build -t tio-server-benchmark -f tio-server.dockerfile .
+```
+The run is to specify the mysql database
+```
+docker run --rm -p 8080:8080 \
+-e JDBC_URL="jdbc:mysql://192.168.3.9/hello_world" \
+-e JDBC_USER="root" \
+-e JDBC_PSWD="robot_123456#" \
+tio-server-benchmark
+```
+
+### windows
+
+-windows
+```
+D:\java\jdk1.8.0_121\bin\java -jar target\tio-server-benchmark-1.0.jar --JDBC_URL=jdbc:mysql://192.168.3.9/hello_world?useSSL=false --JDBC_USER=root --JDBC_PSWD=robot_123456#
+```
+or 
+```
+set JDBC_URL=jdbc:mysql://192.168.3.9/hello_world
+set jdbc.user=root
+set JDBC_PSWD=robot_123456#
+D:\java\jdk1.8.0_121\bin\java -jar target\tio-server-benchmark-1.0.jar
+```
+
+
+

+ 227 - 0
frameworks/Java/tio-boot/api/tio-server-benchmark.md

@@ -0,0 +1,227 @@
+---
+title: tio-server-benchmark v1.0.0
+language_tabs:
+  - shell: Shell
+  - http: HTTP
+  - javascript: JavaScript
+  - ruby: Ruby
+  - python: Python
+  - php: PHP
+  - java: Java
+  - go: Go
+toc_footers: []
+includes: []
+search: true
+code_clipboard: true
+highlight_theme: darkula
+headingLevel: 2
+generator: "@tarslib/widdershins v4.0.17"
+
+---
+
+# tio-server-benchmark
+
+> v1.0.0
+
+Base URLs:
+
+# Authentication
+
+# Default
+
+## GET plaintext
+
+GET /plaintext
+
+> 返回示例
+
+> 200 Response
+
+```json
+{}
+```
+
+### 返回结果
+
+|状态码|状态码含义|说明|数据模型|
+|---|---|---|---|
+|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline|
+
+### 返回数据结构
+
+## GET json
+
+GET /json
+
+> 返回示例
+
+> 200 Response
+
+```json
+{}
+```
+
+### 返回结果
+
+|状态码|状态码含义|说明|数据模型|
+|---|---|---|---|
+|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline|
+
+### 返回数据结构
+
+## GET db
+
+GET /db
+
+### 请求参数
+
+|名称|位置|类型|必选|说明|
+|---|---|---|---|---|
+|id|query|string| 否 |none|
+
+> 返回示例
+
+> 200 Response
+
+```json
+{
+  "id": 0,
+  "randomNumber": 0
+}
+```
+
+### 返回结果
+
+|状态码|状态码含义|说明|数据模型|
+|---|---|---|---|
+|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline|
+
+### 返回数据结构
+
+状态码 **200**
+
+|名称|类型|必选|约束|中文名|说明|
+|---|---|---|---|---|---|
+|» id|integer|true|none||none|
+|» randomNumber|integer|true|none||none|
+
+## GET updates
+
+GET /updates
+
+### 请求参数
+
+|名称|位置|类型|必选|说明|
+|---|---|---|---|---|
+|queries|query|string| 否 |none|
+
+> 返回示例
+
+> 成功
+
+```json
+[
+  {
+    "id": 28,
+    "randomNumber": 5399,
+    "randomnumber": 1498
+  }
+]
+```
+
+### 返回结果
+
+|状态码|状态码含义|说明|数据模型|
+|---|---|---|---|
+|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline|
+
+### 返回数据结构
+
+状态码 **200**
+
+|名称|类型|必选|约束|中文名|说明|
+|---|---|---|---|---|---|
+|» id|integer|false|none||none|
+|» randomNumber|integer|false|none||none|
+|» randomnumber|integer|false|none||none|
+
+## GET fortunes
+
+GET /fortunes
+
+> 返回示例
+
+> 200 Response
+
+```json
+{}
+```
+
+### 返回结果
+
+|状态码|状态码含义|说明|数据模型|
+|---|---|---|---|
+|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline|
+
+### 返回数据结构
+
+## GET cacheQuery
+
+GET /cacheQuery
+
+### 请求参数
+
+|名称|位置|类型|必选|说明|
+|---|---|---|---|---|
+|queries|query|string| 否 |none|
+
+> 返回示例
+
+> 200 Response
+
+```json
+[
+  {
+    "id": 0,
+    "randomNumber": 0
+  }
+]
+```
+
+### 返回结果
+
+|状态码|状态码含义|说明|数据模型|
+|---|---|---|---|
+|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline|
+
+### 返回数据结构
+
+状态码 **200**
+
+|名称|类型|必选|约束|中文名|说明|
+|---|---|---|---|---|---|
+|» id|integer|false|none||none|
+|» randomNumber|integer|false|none||none|
+
+## GET cacheList
+
+GET /cacheList
+
+> 返回示例
+
+> 200 Response
+
+```json
+{}
+```
+
+### 返回结果
+
+|状态码|状态码含义|说明|数据模型|
+|---|---|---|---|
+|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline|
+
+### 返回数据结构
+
+# 数据模型
+

+ 29 - 0
frameworks/Java/tio-boot/benchmark_config.json

@@ -0,0 +1,29 @@
+{
+  "framework": "tio-boot",
+  "tests": [{
+    "default": {
+      "plaintext_url": "/plaintext",
+      "json_url": "/json",
+      "db_url": "/db",
+      "query_url": "/queries?queries=",
+      "fortune_url": "/fortunes",
+      "update_url": "/updates?queries=",
+      "cached_query_url" : "/cachedQuery?queries=",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Micro",
+      "database": "MySQL",
+      "framework": "tio-boot",
+      "language": "Java",
+      "flavor": "None",
+      "orm": "Raw",
+      "platform": "t-io",
+      "webserver": "None",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "tio-boot",
+      "notes": "tio-boot",
+      "versus": "t-io"
+    }
+  }]
+}

+ 19 - 0
frameworks/Java/tio-boot/config.toml

@@ -0,0 +1,19 @@
+[framework]
+name = "t-io"
+
+[main]
+urls.plaintext = "/plaintext"
+urls.json = "/json"
+urls.query = "/queries?queries="
+urls.update = "/updates?queries="
+urls.fortune = "/fortunes"
+urls.cached_query = "/cachedQuery?queries="
+approach = "Realistic"
+classification = "Micro"
+database = "None"
+database_os = "Linux"
+os = "Linux"
+orm = "Raw"
+platform = "t-io"
+webserver = "None"
+versus = "t-io"

+ 126 - 0
frameworks/Java/tio-boot/pom.xml

@@ -0,0 +1,126 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>com.litongjava</groupId>
+  <artifactId>tio-boot-benchmark</artifactId>
+  <version>1.0</version>
+  <name>${project.artifactId}</name>
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <java.version>1.8</java.version>
+    <maven.compiler.source>${java.version}</maven.compiler.source>
+    <maven.compiler.target>${java.version}</maven.compiler.target>
+    <tio-boot.version>1.9.1</tio-boot.version>
+
+    <main.class>com.litongjava.tio.http.server.MainApp</main.class>
+  </properties>
+  <dependencies>
+    <!-- Tio Boot 框架 -->
+    <dependency>
+      <groupId>com.litongjava</groupId>
+      <artifactId>tio-boot</artifactId>
+      <version>${tio-boot.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.litongjava</groupId>
+      <artifactId>java-db</artifactId>
+      <version>1.4.9</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.12</version>
+      <scope>test</scope>
+    </dependency>
+
+
+    <dependency>
+      <groupId>com.alibaba.fastjson2</groupId>
+      <artifactId>fastjson2</artifactId>
+      <version>2.0.52</version>
+    </dependency>
+
+    <dependency>
+      <groupId>net.sf.ehcache</groupId>
+      <artifactId>ehcache-core</artifactId>
+      <version>2.6.11</version>
+    </dependency>
+
+    <dependency>
+      <groupId>mysql</groupId>
+      <artifactId>mysql-connector-java</artifactId>
+      <version>5.1.46</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.zaxxer</groupId>
+      <artifactId>HikariCP</artifactId>
+      <version>4.0.3</version>
+    </dependency>
+
+  </dependencies>
+  <repositories>
+    <repository>
+      <id>central</id>
+      <name>Central Repository</name>
+      <url>https://repo.maven.apache.org/maven2</url>
+    </repository>
+    <repository>
+      <id>sonatype-nexus-snapshots</id>
+      <name>Sonatype Nexus Snapshots</name>
+      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+    </repository>
+  </repositories>
+  <pluginRepositories>
+    <pluginRepository>
+      <id>central</id>
+      <name>Central Repository</name>
+      <url>https://repo.maven.apache.org/maven2</url>
+    </pluginRepository>
+    <pluginRepository>
+      <id>sonatype-nexus-snapshots</id>
+      <name>Sonatype Nexus Snapshots</name>
+      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </pluginRepository>
+  </pluginRepositories>
+  <build>
+    <plugins>
+
+      <plugin>
+        <inherited>true</inherited>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.8.0</version>
+        <configuration>
+          <debug>false</debug>
+        </configuration>
+      </plugin>
+
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <version>3.1.0</version>
+        <configuration>
+          <descriptorRefs>
+            <descriptorRef>jar-with-dependencies</descriptorRef>
+          </descriptorRefs>
+        </configuration>
+        <executions>
+          <execution>
+            <id>make-assembly</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

+ 13 - 0
frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/MainApp.java

@@ -0,0 +1,13 @@
+package com.litongjava.tio.http.server;
+
+import com.litongjava.tio.boot.TioApplication;
+
+public class MainApp {
+
+  public static void main(String[] args) {
+    long start = System.currentTimeMillis();
+    TioApplication.run(MainApp.class, new MainAppConfig(), args);
+    long end = System.currentTimeMillis();
+    System.out.println((end - start) + "ms");
+  }
+}

+ 54 - 0
frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/MainAppConfig.java

@@ -0,0 +1,54 @@
+package com.litongjava.tio.http.server;
+
+import com.litongjava.context.BootConfiguration;
+import com.litongjava.tio.boot.server.TioBootServer;
+import com.litongjava.tio.http.server.config.EhCachePluginConfig;
+import com.litongjava.tio.http.server.config.EnjoyEngineConfig;
+import com.litongjava.tio.http.server.config.MysqlDbConfig;
+import com.litongjava.tio.http.server.controller.CacheHandler;
+import com.litongjava.tio.http.server.controller.DbHandler;
+import com.litongjava.tio.http.server.controller.IndexHandler;
+import com.litongjava.tio.http.server.router.HttpRequestRouter;
+import com.litongjava.tio.utils.environment.EnvUtils;
+
+public class MainAppConfig implements BootConfiguration {
+
+  @Override
+  public void config() throws Exception {
+    // add route
+    IndexHandler controller = new IndexHandler();
+
+    TioBootServer server = TioBootServer.me();
+    HttpRequestRouter requestRouter = server.getRequestRouter();
+
+    requestRouter.add("/", controller::index);
+    requestRouter.add("/plaintext", controller::plaintext);
+    requestRouter.add("/json", controller::json);
+
+    DbHandler dbQueryController = new DbHandler();
+    requestRouter.add("/db", dbQueryController::db);
+    requestRouter.add("/queries", dbQueryController::queries);
+    requestRouter.add("/updates", dbQueryController::updates);
+    requestRouter.add("/fortunes", dbQueryController::fortunes);
+
+    CacheHandler cacheController = new CacheHandler();
+    requestRouter.add("/cachedQuery", cacheController::cachedQuery);
+
+    boolean db = EnvUtils.getBoolean("db", true);
+    if (db) {
+      try {
+        new MysqlDbConfig().init();
+      } catch (Exception e) {
+        e.printStackTrace();
+      }
+    }
+    // start enjoy and ehcache
+    try {
+      new EnjoyEngineConfig().engine();
+      new EhCachePluginConfig().ehCachePlugin();
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
+
+}

+ 12 - 0
frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/config/EhCachePluginConfig.java

@@ -0,0 +1,12 @@
+  package com.litongjava.tio.http.server.config;
+
+import com.litongjava.ehcache.EhCachePlugin;
+
+public class EhCachePluginConfig {
+
+  public EhCachePlugin ehCachePlugin() {
+    EhCachePlugin ehCachePlugin = new EhCachePlugin();
+    ehCachePlugin.start();
+    return ehCachePlugin;
+  }
+}

+ 22 - 0
frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/config/EnjoyEngineConfig.java

@@ -0,0 +1,22 @@
+package com.litongjava.tio.http.server.config;
+
+import com.jfinal.template.Engine;
+
+public class EnjoyEngineConfig {
+
+  private final String RESOURCE_BASE_PATH = "/templates/";
+
+  public Engine engine() {
+    Engine engine = Engine.use();
+    engine.setBaseTemplatePath(RESOURCE_BASE_PATH);
+    engine.setToClassPathSourceFactory();
+    // 支持模板热加载,绝大多数生产环境下也建议配置成 true,除非是极端高性能的场景
+    // engine.setDevMode(true);
+    // 配置极速模式,性能提升 13%
+    Engine.setFastMode(true);
+    // jfinal 4.9.02 新增配置:支持中文表达式、中文变量名、中文方法名、中文模板函数名
+    Engine.setChineseExpression(true);
+    return engine;
+  }
+
+}

+ 31 - 0
frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/config/MysqlDbConfig.java

@@ -0,0 +1,31 @@
+package com.litongjava.tio.http.server.config;
+
+import com.litongjava.db.activerecord.ActiveRecordPlugin;
+import com.litongjava.db.activerecord.OrderedFieldContainerFactory;
+import com.litongjava.db.hikaricp.HikariCpPlugin;
+import com.litongjava.tio.utils.environment.EnvUtils;
+
+public class MysqlDbConfig {
+
+  public void init() {
+    // start active recored
+    String jdbcUrl = EnvUtils.get("JDBC_URL");
+    // String jdbcUrl = "jdbc:mysql://192.168.3.9/hello_world";
+
+    String jdbcUser = EnvUtils.get("JDBC_USER");
+    // String jdbcUser = "root";
+
+    String jdbcPswd = EnvUtils.get("JDBC_PSWD");
+    // String jdbcPswd = "robot_123456#";
+    HikariCpPlugin hikariCpPlugin = new HikariCpPlugin(jdbcUrl, jdbcUser, jdbcPswd);
+
+    ActiveRecordPlugin arp = new ActiveRecordPlugin(hikariCpPlugin);
+    arp.setContainerFactory(new OrderedFieldContainerFactory());
+
+    // arp.setShowSql(true);
+
+    hikariCpPlugin.start();
+    boolean start = arp.start();
+    System.out.println("db started:" + start);
+  }
+}

+ 41 - 0
frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/controller/CacheHandler.java

@@ -0,0 +1,41 @@
+package com.litongjava.tio.http.server.controller;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+import com.alibaba.fastjson2.JSON;
+import com.litongjava.db.activerecord.Db;
+import com.litongjava.db.activerecord.Row;
+import com.litongjava.tio.http.common.HeaderName;
+import com.litongjava.tio.http.common.HeaderValue;
+import com.litongjava.tio.http.common.HttpRequest;
+import com.litongjava.tio.http.common.HttpResponse;
+import com.litongjava.tio.http.server.utils.RandomUtils;
+
+public class CacheHandler {
+  // private Logger log = LoggerFactory.getLogger(this.getClass());
+
+  public HttpResponse cachedQuery(HttpRequest request) {
+    String queries = request.getParam("queries");
+    List<Map<String, Object>> recordMaps = RandomUtils.randomWorldNumbers()
+        // limit
+        .limit(RandomUtils.parseQueryCount(queries)) // 限制查询数量
+        .mapToObj(id -> findByIdWithCache("world", id)) // 使用 mapToObj 将 int 映射为对象
+        .filter(Objects::nonNull) // 过滤掉 null 值
+        .map(Row::toMap) // 将每个 Record 对象转换为 Map
+        .collect(Collectors.toList()); // 收集到 List
+
+    HttpResponse httpResponse = new HttpResponse(request);
+    httpResponse.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN_JSON);
+    httpResponse.setBody(JSON.toJSONBytes(recordMaps));
+    return httpResponse;
+
+  }
+
+  private Row findByIdWithCache(String tableName, int id) {
+    String sql = "SELECT id, randomNumber FROM world WHERE id = ?";
+    return Db.findFirstByCache(tableName, id, sql, id);
+  }
+}

+ 126 - 0
frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/controller/DbHandler.java

@@ -0,0 +1,126 @@
+package com.litongjava.tio.http.server.controller;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+import com.alibaba.fastjson2.JSON;
+import com.jfinal.template.Engine;
+import com.jfinal.template.Template;
+import com.litongjava.db.activerecord.Db;
+import com.litongjava.db.activerecord.Row;
+import com.litongjava.ehcache.EhCacheKit;
+import com.litongjava.tio.http.common.HeaderName;
+import com.litongjava.tio.http.common.HeaderValue;
+import com.litongjava.tio.http.common.HttpRequest;
+import com.litongjava.tio.http.common.HttpResponse;
+import com.litongjava.tio.http.server.model.Fortune;
+import com.litongjava.tio.http.server.util.Resps;
+import com.litongjava.tio.http.server.utils.RandomUtils;
+
+public class DbHandler {
+
+  public HttpResponse db(HttpRequest request) {
+    Integer id = request.getInt("id");
+    if (id == null) {
+      id = RandomUtils.randomWorldNumber();
+    }
+
+    //System.out.println("id:" + id);
+    HttpResponse httpResponse = new HttpResponse(request);
+
+    // int id = 11;
+    // String sql="SELECT id, randomNumber FROM world WHERE id = ?";
+
+    Row recored = Db.findById("world", id);
+    if (recored != null) {
+      httpResponse.setBody(JSON.toJSONBytes(recored.toMap()));
+    } else {
+      httpResponse.setBody("{}".getBytes());
+    }
+
+    httpResponse.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN_JSON);
+
+    return httpResponse;
+  }
+
+  // @GetMapping("/queries")
+  public HttpResponse queries(HttpRequest request) {
+    String queries = request.getParam("queries");
+    List<Map<String, Object>> recordMaps = RandomUtils.randomWorldNumbers()
+        // limit
+        .limit(RandomUtils.parseQueryCount(queries)) // 限制查询数量
+        .mapToObj(id -> Db.findById("world", id)) // 使用 mapToObj 将 int 映射为对象
+        .filter(Objects::nonNull) // 过滤掉 null 值
+        .map(Row::toMap) // 将每个 Record 对象转换为 Map
+        .collect(Collectors.toList()); // 收集到 List
+
+    HttpResponse httpResponse = new HttpResponse(request);
+    httpResponse.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN_JSON);
+    httpResponse.setBody(JSON.toJSONBytes(recordMaps));
+    return httpResponse;
+  }
+
+  //@GetMapping("/updates")
+  public HttpResponse updates(HttpRequest request) {
+    String queries = request.getParam("queries");
+
+    EhCacheKit.removeAll("world");
+
+    List<Map<String, Object>> updatedRecords = RandomUtils.randomWorldNumbers()// random numbers
+        // limit
+        .limit(RandomUtils.parseQueryCount(queries))
+        // map
+        .mapToObj(id -> Db.findById("world", id))
+        // not null
+        .filter(Objects::nonNull).map(record -> {
+          int currentRandomNumber = record.getInt("randomNumber"); // "randomnumber"
+          int newRandomNumber;
+          do {
+            newRandomNumber = RandomUtils.randomWorldNumber();
+          } while (newRandomNumber == currentRandomNumber);
+
+          record.set("randomnumber", newRandomNumber);
+          Db.update("world", "id", record); // update
+          return record;
+        })
+        // tomap
+        .map(Row::toMap)
+        // to List
+        .collect(Collectors.toList());
+
+    HttpResponse httpResponse = new HttpResponse(request);
+    httpResponse.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN_JSON);
+    httpResponse.setBody(JSON.toJSONBytes(updatedRecords));
+    return httpResponse;
+  }
+
+  public HttpResponse fortunes(HttpRequest request) throws IllegalAccessException, InstantiationException {
+    List<Row> records = Db.find("SELECT * FROM fortune");
+
+    List<Fortune> fortunes = new ArrayList<>(records.size());
+    for (Row record : records) {
+      fortunes.add(record.toBean(Fortune.class));
+    }
+    // 添加额外的 Fortune
+    fortunes.add(new Fortune(0L, "Additional fortune added at request time."));
+
+    // 按照消息排序
+    fortunes.sort(Comparator.comparing(Fortune::getMessage));
+
+    Map<String, Object> viewData = new HashMap<>();
+    viewData.put("fortunes", fortunes);
+
+    // 转换为 HTML
+    Engine engine = Engine.use();
+    String filename = "fortunes.html";
+    Template template = engine.getTemplate(filename);
+    String html = template.renderToString(viewData);
+
+    return Resps.html(request, html);
+  }
+}

+ 40 - 0
frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/controller/IndexHandler.java

@@ -0,0 +1,40 @@
+package com.litongjava.tio.http.server.controller;
+
+import com.alibaba.fastjson2.JSON;
+import com.litongjava.tio.http.common.HeaderName;
+import com.litongjava.tio.http.common.HeaderValue;
+import com.litongjava.tio.http.common.HttpRequest;
+import com.litongjava.tio.http.common.HttpResponse;
+import com.litongjava.tio.http.server.model.Message;
+import com.litongjava.tio.http.server.util.Resps;
+
+/**
+ * ab -k -n1000000 -c10 http://127.0.0.1:8080/json 
+ * ab -k -n1000000 -c10 http://127.0.0.1:8080/plaintext
+ */
+public class IndexHandler {
+  private static final String HELLO_WORLD = "Hello, World!";
+
+  private static final byte[] HELLO_WORLD_BYTES = HELLO_WORLD.getBytes();
+
+  public HttpResponse index(HttpRequest request) {
+    return Resps.txt(request, "tio-boot");
+  }
+
+  public HttpResponse plaintext(HttpRequest request) {
+    // 更高性能的写法
+    HttpResponse ret = new HttpResponse(request);
+    ret.setBody(HELLO_WORLD_BYTES);
+    ret.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN_TXT);
+    return ret;
+  }
+
+  // 在IndexController中添加
+  public HttpResponse json(HttpRequest request) {
+    // 更高性能的写法
+    HttpResponse ret = new HttpResponse(request);
+    ret.setBody(JSON.toJSONString(new Message(HELLO_WORLD)).getBytes());
+    ret.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN_JSON);
+    return ret;
+  }
+}

+ 23 - 0
frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/model/Fortune.java

@@ -0,0 +1,23 @@
+package com.litongjava.tio.http.server.model;
+
+public final class Fortune {
+
+  public Long id;
+  public String message;
+
+  public Fortune() {
+  }
+
+  public Fortune(Long id, String message) {
+    this.id = id;
+    this.message = message;
+  }
+
+  public Long getId() {
+    return id;
+  }
+
+  public String getMessage() {
+    return message;
+  }
+}

+ 12 - 0
frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/model/Message.java

@@ -0,0 +1,12 @@
+package com.litongjava.tio.http.server.model;
+public final class Message {
+	private final String message;
+
+	public Message(String message) {
+		this.message = message;
+	}
+
+	public String getMessage() {
+		return message;
+	}
+}

+ 32 - 0
frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/model/World.java

@@ -0,0 +1,32 @@
+package com.litongjava.tio.http.server.model;
+
+public final class World {
+
+  public int id;
+  public int randomnumber;
+
+  protected World() {
+  }
+
+  public World(int id, int randomnumber) {
+    this.id = id;
+    this.randomnumber = randomnumber;
+  }
+
+  public int getId() {
+    return id;
+  }
+
+  public void setId(int id) {
+    this.id = id;
+  }
+
+  public int getRandomnumber() {
+    return randomnumber;
+  }
+
+  public void setRandomnumber(int randomnumber) {
+    this.randomnumber = randomnumber;
+  }
+
+}

+ 50 - 0
frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/services/CacheName.java

@@ -0,0 +1,50 @@
+package com.litongjava.tio.http.server.services;
+
+public class CacheName {
+  // `cacheName`(缓存名称)
+  private String name;
+  // `timeToLiveSeconds`(生存时间)和`timeToIdleSeconds`(闲置时间)。
+  private Long timeToLiveSeconds;
+  private Long timeToIdleSeconds;
+
+  public CacheName() {
+  }
+
+  public CacheName(String name, Long timeToLiveSeconds, Long timeToIdleSeconds) {
+    super();
+    this.name = name;
+    this.timeToLiveSeconds = timeToLiveSeconds;
+    this.timeToIdleSeconds = timeToIdleSeconds;
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public Long getTimeToLiveSeconds() {
+    return timeToLiveSeconds;
+  }
+
+  public void setTimeToLiveSeconds(Long timeToLiveSeconds) {
+    this.timeToLiveSeconds = timeToLiveSeconds;
+  }
+
+  public Long getTimeToIdleSeconds() {
+    return timeToIdleSeconds;
+  }
+
+  public void setTimeToIdleSeconds(Long timeToIdleSeconds) {
+    this.timeToIdleSeconds = timeToIdleSeconds;
+  }
+
+  @Override
+  public String toString() {
+    return "CacheName [name=" + name + ", timeToLiveSeconds=" + timeToLiveSeconds + ", timeToIdleSeconds="
+        + timeToIdleSeconds + "]";
+  }
+
+}

+ 17 - 0
frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/services/CacheNameService.java

@@ -0,0 +1,17 @@
+package com.litongjava.tio.http.server.services;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.litongjava.model.time.Time;
+
+public class CacheNameService {
+  private CacheName demo = new CacheName("world", null, Time.MINUTE_1 * 10);
+
+  public List<CacheName> cacheNames() {
+    List<CacheName> list = new ArrayList<>();
+    list.add(demo);
+    return list;
+  }
+
+}

+ 36 - 0
frameworks/Java/tio-boot/src/main/java/com/litongjava/tio/http/server/utils/RandomUtils.java

@@ -0,0 +1,36 @@
+package com.litongjava.tio.http.server.utils;
+
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.stream.IntStream;
+
+public class RandomUtils {
+
+  private static final int MIN_WORLD_NUMBER = 1;
+  private static final int MAX_WORLD_NUMBER_PLUS_ONE = 10_001;
+//  private static final int MAX_WORLD_NUMBER_PLUS_ONE = 30;
+
+  public static int randomWorldNumber() {
+    return ThreadLocalRandom.current().nextInt(MIN_WORLD_NUMBER, MAX_WORLD_NUMBER_PLUS_ONE);
+  }
+
+  public static IntStream randomWorldNumbers() {
+    return ThreadLocalRandom.current().ints(MIN_WORLD_NUMBER, MAX_WORLD_NUMBER_PLUS_ONE)
+        // distinct() allows us to avoid using Hibernate's first-level cache in
+        // the JPA-based implementation. Using a cache like that would bypass
+        // querying the database, which would violate the test requirements.
+        .distinct();
+  }
+
+  public static int parseQueryCount(String textValue) {
+    if (textValue == null) {
+      return 1;
+    }
+    int parsedValue;
+    try {
+      parsedValue = Integer.parseInt(textValue);
+    } catch (NumberFormatException e) {
+      return 1;
+    }
+    return Math.min(500, Math.max(1, parsedValue));
+  }
+}

+ 9 - 0
frameworks/Java/tio-boot/src/main/resources/app.properties

@@ -0,0 +1,9 @@
+http.response.header.showServer=true
+server.port=8080
+#JDBC_URL=jdbc:mysql://192.168.3.9/hello_world?useSSL=false&allowPublicKeyRetrieval=true
+#JDBC_USER=root
+#JDBC_PSWD=robot_123456#
+
+JDBC_URL=jdbc:mysql://tfb-database/hello_world
+JDBC_USER=benchmarkdbuser
+JDBC_PSWD=benchmarkdbpass

+ 9 - 0
frameworks/Java/tio-boot/src/main/resources/ehcache.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd" updateCheck="false">
+
+  <diskStore path="java.io.tmpdir/EhCache" />
+
+  <defaultCache eternal="false" maxElementsInMemory="10000" overflowToDisk="false" diskPersistent="false"
+                timeToIdleSeconds="1800" timeToLiveSeconds="259200" memoryStoreEvictionPolicy="LRU" />
+</ehcache>

+ 52 - 0
frameworks/Java/tio-boot/src/main/resources/logback.xml

@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<configuration>
+  <!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径 -->
+  <property name="LOG_HOME" value="logs" />
+  <!--格式化输出:%d表示日期,%-6level:日志级别从左显示6个字符宽度,%m:日志消息,%n是换行符 -->
+  <property name="CONSOLE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-6level%logger{0}.%M:%L - %m%n" />
+
+  <!-- 控制台输出 -->
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+      <pattern>${CONSOLE_LOG_PATTERN}</pattern>
+    </encoder>
+  </appender>
+
+  <!-- 按照每天生成日志文件 -->
+  <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+      <pattern>${CONSOLE_LOG_PATTERN}</pattern>
+    </encoder>
+    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+      <!--日志文件输出的文件名 -->
+      <fileNamePattern>${LOG_HOME}/project-name-%d{yyyy-MM-dd}.log</fileNamePattern>
+      <!--日志文件保留天数 -->
+      <maxHistory>180</maxHistory>
+    </rollingPolicy>
+    <!--日志文件最大的大小 -->
+    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <maxFileSize>10MB</maxFileSize>
+    </triggeringPolicy>
+  </appender>
+  
+  <!--专为 spring 定制 -->
+  <logger name="org.springframework" level="info" />
+  <!-- show parameters for hibernate sql 专为 Hibernate 定制 -->
+  <logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
+  <logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="DEBUG" />
+  <logger name="org.hibernate.SQL" level="DEBUG" />
+  <logger name="org.hibernate.engine.QueryParameters" level="DEBUG" />
+  <logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
+
+  <!--myibatis log configure -->
+  <logger name="com.apache.ibatis" level="TRACE" />
+  <logger name="java.sql.Connection" level="DEBUG" />
+  <logger name="java.sql.Statement" level="DEBUG" />
+  <logger name="java.sql.PreparedStatement" level="DEBUG" />
+
+  <!-- 日志输出级别 和输出源 -->
+  <root level="info">
+    <appender-ref ref="STDOUT" />
+    <appender-ref ref="FILE" />
+  </root>
+</configuration>

+ 20 - 0
frameworks/Java/tio-boot/src/main/resources/templates/fortunes.html

@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>Fortunes</title>
+</head>
+<body>
+<table>
+  <tr>
+    <th>id</th>
+    <th>message</th>
+  </tr>
+  #for(fortune : fortunes)
+  <tr>
+    <td>#(fortune.id)</td>
+    <td>#escape(fortune.message)</td>
+  </tr>
+  #end
+</table>
+</body>
+</html>

+ 15 - 0
frameworks/Java/tio-boot/src/test/java/com/litongjava/tio/http/server/MainAppTest.java

@@ -0,0 +1,15 @@
+package com.litongjava.tio.http.server;
+
+import org.junit.Test;
+
+import com.litongjava.tio.utils.environment.EnvUtils;
+
+public class MainAppTest {
+
+  @Test
+  public void test() {
+    boolean boolean1 = EnvUtils.getBoolean("native", false);
+    System.out.println(boolean1);
+  }
+
+}

+ 20 - 0
frameworks/Java/tio-boot/tio-boot.dockerfile

@@ -0,0 +1,20 @@
+FROM litongjava/maven:3.8.8-jdk8u391 AS builder
+WORKDIR /app
+
+COPY pom.xml pom.xml
+RUN mvn dependency:go-offline  -q
+
+COPY src src
+RUN mvn package -Passembly -q
+RUN ls -l && ls -l target
+
+FROM litongjava/jre:8u391-stable-slim
+
+WORKDIR /app
+
+COPY --from=builder /app/target/tio-boot-benchmark-1.0-jar-with-dependencies.jar /app/tio-boot-benchmark-1.0.jar
+
+EXPOSE 8080
+
+# java --server -XX:+UseNUMA XX:+UseParallelGC -cp target/tio-boot-benchmark-1.0-jar-with-dependencies.jar com.litongjava.tio.http.server.MainApp
+CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC","-cp", "/app/tio-boot-benchmark-1.0.jar","com.litongjava.tio.http.server.MainApp"]

+ 27 - 0
frameworks/JavaScript/aroma.js/README.md

@@ -0,0 +1,27 @@
+# Aroma.js Benchmarking Test
+
+From [aroma.js.org](https://aroma.js.org):
+
+> Aroma.js is a lightweight, feature-rich, and developer-friendly web framework designed to build modern web applications with ease. It provides essential features like routing, middleware, session management, cookie handling, template rendering, static file serving, and more. With its simple API, it enables rapid development of web applications with flexibility.
+
+### Test Type Implementation Source Code
+
+- [JSON](app.js)
+- [PLAINTEXT](app.js)
+
+## Important Libraries
+
+The tests were run with:
+
+- [Aroma.js](https://aroma.js.org/)
+- [NodeJS](https://nodejs.org/en/)
+
+## Test URLs
+
+### JSON
+
+http://localhost:8080/json
+
+### PLAINTEXT
+
+http://localhost:8080/plaintext

+ 36 - 0
frameworks/JavaScript/aroma.js/app.js

@@ -0,0 +1,36 @@
+
+const cluster = require('cluster'),
+  numCPUs = require('os').cpus().length,
+  Aroma = require('aroma.js');
+
+
+if (cluster.isPrimary) {
+  console.log(`Primary ${process.pid} is running`);
+
+  for (let i = 0; i < numCPUs; i++) {
+    cluster.fork();
+  }
+
+  cluster.on('exit', (worker, code, signal) => {
+    console.log(`worker ${worker.process.pid} died`);
+  });
+} else {
+  const app = module.exports = new Aroma();
+
+  app.parseUrlEncoded();
+
+   app.use((req, res, next) => {
+    res.setHeader("Server", "Aroma.js");
+    return next();
+  });
+
+  app.get('/json', (req, res) => res.send({ message: 'Hello, World!' }));
+
+  app.get('/plaintext', (req, res) => {
+    res.setHeader('Content-Type', 'text/plain');
+    res.send('Hello, World!');
+  });
+  
+
+  app.listen(8080);
+}

+ 11 - 0
frameworks/JavaScript/aroma.js/aroma.js.dockerfile

@@ -0,0 +1,11 @@
+FROM node:20.16-slim
+
+COPY ./ ./
+
+RUN npm install
+
+ENV NODE_ENV production
+
+EXPOSE 8080
+
+CMD ["node", "app.js"]

+ 21 - 0
frameworks/JavaScript/aroma.js/benchmark_config.json

@@ -0,0 +1,21 @@
+{
+    "framework": "aroma.js",
+    "tests": [{
+      "default": {
+        "json_url": "/json",
+        "plaintext_url": "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "framework": "aroma.js",
+        "language": "JavaScript",
+        "flavor": "NodeJS",
+        "platform": "nodejs",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "aroma.js",
+        "versus": "nodejs"
+      }
+    }]
+  }

+ 13 - 0
frameworks/JavaScript/aroma.js/config.toml

@@ -0,0 +1,13 @@
+[framework]
+name = "aroma.js"
+
+[main]
+urls.plaintext = "/plaintext"
+urls.json = "/json"
+approach = "Realistic"
+classification = "Micro"
+database_os = "Linux"
+os = "Linux"
+platform = "nodejs"
+webserver = "None"
+versus = "nodejs"

+ 8 - 0
frameworks/JavaScript/aroma.js/package.json

@@ -0,0 +1,8 @@
+{
+    "name": "aroma.js",
+    "dependencies": {
+      "aroma.js": "1.0.8"
+    },
+    "main": "app.js"
+  }
+  

+ 1 - 1
frameworks/JavaScript/koa/package.json

@@ -7,7 +7,7 @@
   "dependencies": {
   "dependencies": {
     "bluebird": "3.5.1",
     "bluebird": "3.5.1",
     "handlebars": "4.3.0",
     "handlebars": "4.3.0",
-    "koa": "2.5.0",
+    "koa": "2.15.4",
     "koa-bodyparser": "4.2.0",
     "koa-bodyparser": "4.2.0",
     "koa-hbs": "1.0.0",
     "koa-hbs": "1.0.0",
     "koa-router": "7.4.0",
     "koa-router": "7.4.0",

+ 4 - 4
frameworks/Kotlin/hexagon/benchmark_config.json

@@ -48,7 +48,7 @@
                 "notes": "http://hexagonkt.com",
                 "notes": "http://hexagonkt.com",
                 "versus": "servlet"
                 "versus": "servlet"
             },
             },
-            "jettyloom": {
+            "jdk": {
                 "json_url": "/json",
                 "json_url": "/json",
                 "db_url": "/db",
                 "db_url": "/db",
                 "query_url": "/query?queries=",
                 "query_url": "/query?queries=",
@@ -67,11 +67,11 @@
                 "webserver": "None",
                 "webserver": "None",
                 "os": "Linux",
                 "os": "Linux",
                 "database_os": "Linux",
                 "database_os": "Linux",
-                "display_name": "Hexagon Jetty Loom PostgreSQL",
+                "display_name": "Hexagon JDK PostgreSQL",
                 "notes": "http://hexagonkt.com",
                 "notes": "http://hexagonkt.com",
                 "versus": "servlet"
                 "versus": "servlet"
             },
             },
-            "jettyloom-pgclient": {
+            "jdk-pgclient": {
                 "json_url": "/json",
                 "json_url": "/json",
                 "db_url": "/db",
                 "db_url": "/db",
                 "query_url": "/query?queries=",
                 "query_url": "/query?queries=",
@@ -90,7 +90,7 @@
                 "webserver": "None",
                 "webserver": "None",
                 "os": "Linux",
                 "os": "Linux",
                 "database_os": "Linux",
                 "database_os": "Linux",
-                "display_name": "Hexagon Jetty Loom PgClient",
+                "display_name": "Hexagon JDK PgClient",
                 "notes": "http://hexagonkt.com",
                 "notes": "http://hexagonkt.com",
                 "versus": "servlet"
                 "versus": "servlet"
             },
             },

+ 10 - 10
frameworks/Kotlin/hexagon/build.gradle

@@ -1,26 +1,26 @@
 
 
 plugins {
 plugins {
-    id "org.jetbrains.kotlin.jvm" version "2.0.21" apply false
-    id "org.graalvm.buildtools.native" version "0.10.4" apply false
+    id "org.jetbrains.kotlin.jvm" version "2.1.0" apply false
+    id "org.graalvm.buildtools.native" version "0.10.5" apply false
 }
 }
 
 
 version = "1.0.0"
 version = "1.0.0"
 description = "TFB benchmark"
 description = "TFB benchmark"
-group = "com.hexagonkt"
+group = "com.hexagontk"
 
 
 ext {
 ext {
-    hexagonVersion = "3.7.3"
+    hexagonVersion = "4.0.1"
     jettyVersion = "12.0.16"
     jettyVersion = "12.0.16"
-    nettyVersion = "4.1.116.Final"
+    nettyVersion = "4.1.118.Final"
 
 
     hikariVersion = "6.2.1"
     hikariVersion = "6.2.1"
-    postgresqlVersion = "42.7.4"
-    vertxVersion = "4.5.11"
+    postgresqlVersion = "42.7.5"
+    vertxVersion = "4.5.12"
     cache2kVersion = "2.6.1.Final"
     cache2kVersion = "2.6.1.Final"
 
 
-    applicationClass = "com.hexagonkt.BenchmarkKt"
+    applicationClass = "com.hexagontk.BenchmarkKt"
     modules = "java.naming,java.sql,java.management"
     modules = "java.naming,java.sql,java.management"
-    gradleScripts = "https://raw.githubusercontent.com/hexagonkt/hexagon/$hexagonVersion/gradle"
+    gradleScripts = "https://raw.githubusercontent.com/hexagontk/hexagon/$hexagonVersion/gradle"
 }
 }
 
 
 subprojects {
 subprojects {
@@ -30,5 +30,5 @@ subprojects {
 }
 }
 
 
 tasks.wrapper {
 tasks.wrapper {
-    gradleVersion = "8.10.2"
+    gradleVersion = "8.12.1"
 }
 }

+ 2 - 2
frameworks/Kotlin/hexagon/config.toml

@@ -19,7 +19,7 @@ platform = "Servlet"
 webserver = "None"
 webserver = "None"
 versus = "servlet"
 versus = "servlet"
 
 
-[jettyloom]
+[jdk]
 urls.plaintext = "/plaintext"
 urls.plaintext = "/plaintext"
 urls.json = "/json"
 urls.json = "/json"
 urls.db = "/db"
 urls.db = "/db"
@@ -37,7 +37,7 @@ platform = "Servlet"
 webserver = "None"
 webserver = "None"
 versus = "servlet"
 versus = "servlet"
 
 
-[jettyloom-pgclient]
+[jdk-pgclient]
 urls.plaintext = "/plaintext"
 urls.plaintext = "/plaintext"
 urls.json = "/json"
 urls.json = "/json"
 urls.db = "/db"
 urls.db = "/db"

+ 5 - 5
frameworks/Kotlin/hexagon/core/build.gradle

@@ -1,16 +1,16 @@
 
 
 plugins {
 plugins {
-    id("gg.jte.gradle") version("3.1.4")
+    id("gg.jte.gradle") version("3.1.13")
 }
 }
 
 
 dependencies {
 dependencies {
     api(project(":model"))
     api(project(":model"))
-    api("com.hexagonkt:http_server:$hexagonVersion")
-    api("com.hexagonkt:templates_jte:$hexagonVersion")
-    api("com.hexagonkt:serialization_jackson_json:$hexagonVersion")
+    api("com.hexagontk.http:http_server:$hexagonVersion")
+    api("com.hexagontk.templates:templates_jte:$hexagonVersion")
+    api("com.hexagontk.serialization:serialization_jackson_json:$hexagonVersion")
     api("org.cache2k:cache2k-core:$cache2kVersion")
     api("org.cache2k:cache2k-core:$cache2kVersion")
 
 
-    jteGenerate("gg.jte:jte-native-resources:3.1.4")
+    jteGenerate("gg.jte:jte-native-resources:3.1.13")
 }
 }
 
 
 tasks.register("minimizeTemplate") {
 tasks.register("minimizeTemplate") {

+ 6 - 6
frameworks/Kotlin/hexagon/core/src/main/kotlin/Benchmark.kt

@@ -1,10 +1,10 @@
-package com.hexagonkt
+package com.hexagontk
 
 
-import com.hexagonkt.http.server.HttpServer
-import com.hexagonkt.http.server.HttpServerPort
-import com.hexagonkt.http.server.HttpServerSettings
-import com.hexagonkt.store.BenchmarkStore
-import com.hexagonkt.templates.TemplatePort
+import com.hexagontk.http.server.HttpServer
+import com.hexagontk.http.server.HttpServerPort
+import com.hexagontk.http.server.HttpServerSettings
+import com.hexagontk.store.BenchmarkStore
+import com.hexagontk.templates.TemplatePort
 import java.net.InetAddress
 import java.net.InetAddress
 import java.net.URL
 import java.net.URL
 
 

+ 20 - 20
frameworks/Kotlin/hexagon/core/src/main/kotlin/Controller.kt

@@ -1,21 +1,21 @@
-package com.hexagonkt
-
-import com.hexagonkt.core.fieldsMapOf
-import com.hexagonkt.core.media.APPLICATION_JSON
-import com.hexagonkt.core.media.TEXT_HTML
-import com.hexagonkt.core.media.TEXT_PLAIN
-import com.hexagonkt.http.model.ContentType
-import com.hexagonkt.http.model.Header
-import com.hexagonkt.http.model.Headers
-import com.hexagonkt.http.server.callbacks.DateCallback
-import com.hexagonkt.http.handlers.HttpContext
-import com.hexagonkt.http.handlers.PathHandler
-import com.hexagonkt.http.handlers.path
-import com.hexagonkt.model.*
-import com.hexagonkt.serialization.jackson.json.Json
-import com.hexagonkt.serialization.serialize
-import com.hexagonkt.store.BenchmarkStore
-import com.hexagonkt.templates.TemplatePort
+package com.hexagontk
+
+import com.hexagontk.core.fieldsMapOf
+import com.hexagontk.core.media.APPLICATION_JSON
+import com.hexagontk.core.media.TEXT_HTML
+import com.hexagontk.core.media.TEXT_PLAIN
+import com.hexagontk.http.model.ContentType
+import com.hexagontk.http.model.Field
+import com.hexagontk.http.model.Headers
+import com.hexagontk.http.server.callbacks.DateCallback
+import com.hexagontk.http.handlers.HttpContext
+import com.hexagontk.http.handlers.PathHandler
+import com.hexagontk.http.handlers.path
+import com.hexagontk.model.*
+import com.hexagontk.serialization.jackson.json.Json
+import com.hexagontk.serialization.serialize
+import com.hexagontk.store.BenchmarkStore
+import com.hexagontk.templates.TemplatePort
 import java.net.URL
 import java.net.URL
 import java.util.concurrent.ThreadLocalRandom
 import java.util.concurrent.ThreadLocalRandom
 import kotlin.text.Charsets.UTF_8
 import kotlin.text.Charsets.UTF_8
@@ -35,7 +35,7 @@ class Controller(
     private val json: ContentType = ContentType(APPLICATION_JSON)
     private val json: ContentType = ContentType(APPLICATION_JSON)
     private val html: ContentType = ContentType(TEXT_HTML, charset = UTF_8)
     private val html: ContentType = ContentType(TEXT_HTML, charset = UTF_8)
 
 
-    private val headers = Headers(Header("server", "Hexagon"))
+    private val headers = Headers(Field("server", "Hexagon"))
 
 
     val path: PathHandler by lazy {
     val path: PathHandler by lazy {
         path {
         path {
@@ -105,7 +105,7 @@ class Controller(
         ok(body.serialize(Json.raw), contentType = json)
         ok(body.serialize(Json.raw), contentType = json)
 
 
     private fun HttpContext.getWorldsCount(parameter: String): Int =
     private fun HttpContext.getWorldsCount(parameter: String): Int =
-        request.queryParameters[parameter]?.string()?.toIntOrNull().let {
+        request.queryParameters[parameter]?.text?.toIntOrNull().let {
             when {
             when {
                 it == null -> 1
                 it == null -> 1
                 it < 1 -> 1
                 it < 1 -> 1

+ 5 - 5
frameworks/Kotlin/hexagon/core/src/main/kotlin/store/BenchmarkStore.kt

@@ -1,9 +1,9 @@
-package com.hexagonkt.store
+package com.hexagontk.store
 
 
-import com.hexagonkt.model.CachedWorld
-import com.hexagonkt.model.Fortune
-import com.hexagonkt.Settings
-import com.hexagonkt.model.World
+import com.hexagontk.model.CachedWorld
+import com.hexagontk.model.Fortune
+import com.hexagontk.Settings
+import com.hexagontk.model.World
 import org.cache2k.Cache
 import org.cache2k.Cache
 import org.cache2k.Cache2kBuilder
 import org.cache2k.Cache2kBuilder
 
 

+ 4 - 1
frameworks/Kotlin/hexagon/core/src/main/resources/META-INF/native-image/com.hexagonkt.benchmark/core/native-image.properties

@@ -3,4 +3,7 @@ Args= \
   --static \
   --static \
   --libc=musl \
   --libc=musl \
   --gc=G1 \
   --gc=G1 \
-  --enable-sbom
+  --enable-sbom \
+  --initialize-at-build-time=org.slf4j.LoggerFactory \
+  --initialize-at-build-time=org.slf4j.helpers.Reporter \
+  --initialize-at-build-time=org.slf4j.LoggerFactoinitialize-at-build-timery

+ 1 - 1
frameworks/Kotlin/hexagon/core/src/main/resources/fortunes.jte

@@ -1,5 +1,5 @@
 @import java.util.*
 @import java.util.*
-@import com.hexagonkt.model.Fortune
+@import com.hexagontk.model.Fortune
 
 
 @param List<Fortune> fortunes
 @param List<Fortune> fortunes
 
 

+ 1 - 1
frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
 distributionBase=GRADLE_USER_HOME
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
 networkTimeout=10000
 networkTimeout=10000
 validateDistributionUrl=true
 validateDistributionUrl=true
 zipStoreBase=GRADLE_USER_HOME
 zipStoreBase=GRADLE_USER_HOME

+ 1 - 2
frameworks/Kotlin/hexagon/gradlew

@@ -86,8 +86,7 @@ done
 # shellcheck disable=SC2034
 # shellcheck disable=SC2034
 APP_BASE_NAME=${0##*/}
 APP_BASE_NAME=${0##*/}
 # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
 # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
-APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
-' "$PWD" ) || exit
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
 
 
 # Use the maximum available, or set MAX_FD != -1 to use that value.
 # Use the maximum available, or set MAX_FD != -1 to use that value.
 MAX_FD=maximum
 MAX_FD=maximum

Some files were not shown because too many files changed in this diff