日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql 结构体_mysql模块使用结构体生成数据库表,不识别long类型

發(fā)布時(shí)間:2023/12/10 数据库 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql 结构体_mysql模块使用结构体生成数据库表,不识别long类型 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

windows環(huán)境:

windows10,vs2017,編譯器最新,支持c++17.

問題描述:

例如結(jié)構(gòu)體:

struct test_create_table

{

//__int64 id; //可以

long id; //不可以,編譯報(bào)錯(cuò)

string name;

};

REFLECTION(test_create_table, id, name)

void test_creat()

{

try

{

dbng mysql;

mysql.connect("127.0.0.1", "root", "123456", "test");

ormpp_key key{ "id" };

ormpp_not_null not_null{ {"id"} };

ormpp_auto_key auto_key{ "id" };

mysql.create_datatable(key, not_null);

}

catch (...)

{

cout << "create table fail" << endl;

}

}

報(bào)錯(cuò)如下:

1>ormpp_test.cpp

1>d:mayun_git\secondarycounter\ormpp_compile\ormpp-master\utility.hpp(84): error C2665: “ormpp::ormpp_mysql::type_to_name”: 7 個(gè)重載中沒有一個(gè)可以轉(zhuǎn)換所有參數(shù)類型

1>d:mayun_git\secondarycounter\ormpp_compile\ormpp-master\type_mapping.hpp(50): note: 可能是“std::string_view ormpp::ormpp_mysql::type_to_name(ormpp::identitystd::string) noexcept”

1>d:\mayun_git\secondarycounter\ormpp_compile\ormpp-master\type_mapping.hpp(49): note: 或 “std::string_view ormpp::ormpp_mysql::type_to_name(ormpp::identity) noexcept”

1>d:\mayun_git\secondarycounter\ormpp_compile\ormpp-master\type_mapping.hpp(48): note: 或 “std::string_view ormpp::ormpp_mysql::type_to_name(ormpp::identity) noexcept”

1>d:\mayun_git\secondarycounter\ormpp_compile\ormpp-master\type_mapping.hpp(47): note: 或 “std::string_view ormpp::ormpp_mysql::type_to_name(ormpp::identity) noexcept”

1>d:mayun_git\secondarycounter\ormpp_compile\ormpp-master\type_mapping.hpp(46): note: 或 “std::string_view ormpp::ormpp_mysql::type_to_name(ormpp::identity) noexcept”

1>d:mayun_git\secondarycounter\ormpp_compile\ormpp-master\type_mapping.hpp(45): note: 或 “std::string_view ormpp::ormpp_mysql::type_to_name(ormpp::identity) noexcept”

1>dmayun_git\secondarycounter\ormpp_compile\ormpp-master\type_mapping.hpp(44): note: 或 “std::string_view ormpp::ormpp_mysql::type_to_name(ormpp::identity) noexcept”

1>d:mayun_git\secondarycounter\ormpp_compile\ormpp-master\utility.hpp(84): note: 嘗試匹配參數(shù)列表“(ormpp::identity)”時(shí)

\mayun_git\secondarycounter\ormpp_compile\iguana\iguana\reflection.hpp(476): note: 參見對(duì)正在編譯的函數(shù) 模板 實(shí)例化“auto ormpp::get_type_names::::operator ()<: const>>(long test_create_table::* const &,std::integral_constant) const”的引用

\mayun_git\secondarycounter\ormpp_compile\iguana\iguana\reflection.hpp(484): note: 參見對(duì)正在編譯的函數(shù) 模板 實(shí)例化“void iguana::for_each<:>(const std::tuple &,F &&,std::integer_sequence)”的引用

1> with

1> [

1> _Ty=ormpp::get_type_names::,

1> F=ormpp::get_type_names::

1> ]

1>\mayun_git\secondarycounter\ormpp_compile\ormpp-master\utility.hpp(98): note: 參見對(duì)正在編譯的函數(shù) 模板 實(shí)例化“void iguana::for_each>(T &&,F &&)”的引用

1> with

1> [

1> T=test_create_table,

1> F=ormpp::get_type_names::

1> ]

1>mayun_git\secondarycounter\ormpp_compile\ormpp-master\mysql.hpp(381): note: 參見對(duì)正在編譯的函數(shù) 模板 實(shí)例化“std::arraystd::string,2 ormpp::get_type_names(ormpp::DBType)”的引用

1> with

1> [

1> T=test_create_table

1> ]

1>dmayun_git\secondarycounter\ormpp_compile\ormpp-master\mysql.hpp(67): note: 參見對(duì)正在編譯的函數(shù) 模板 實(shí)例化“std::string ormpp::mysql::generate_createtb_sql(ormpp_key &,ormpp_not_null &)”的引用

1> with

1> [

1> T=test_create_table

1> ]

1>d:mayun_git\secondarycounter\ormpp_compile\ormpp-master\dbng.hpp(33): note: 參見對(duì)正在編譯的函數(shù) 模板 實(shí)例化“bool ormpp::mysql::create_datatable(ormpp_key &,ormpp_not_null &)”的引用

1> with

1> [

1> T=test_create_table

1> ]

1>d:\mayun_git\secondarycounter\ormpp_compile\ormpp-master\ormpp_test\ormpp_test.cpp(61): note: 參見對(duì)正在編譯的函數(shù) 模板 實(shí)例化“bool ormpp::dbngormpp::mysql::create_datatable(ormpp_key &,ormpp_not_null &)”的引用

1>dmayun_git\secondarycounter\ormpp_compile\ormpp-master\ormpp_test\ormpp_test.cpp(61): note: 參見對(duì)正在編譯的函數(shù) 模板 實(shí)例化“bool ormpp::dbngormpp::mysql::create_datatable(ormpp_key &,ormpp_not_null &)”的引用

1>d:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.14.26428\include\type_traits(520): note: 參見對(duì)正在編譯的 類 模板 實(shí)例化 "std::basic_string_view" 的引用

1>d:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.14.26428\include\type_traits(1358): note: 參見對(duì)正在編譯的 類 模板 實(shí)例化 "std::is_convertible>" 的引用

1> with

1> [

1> _StringViewIsh=char [2]

1> ]

1>d:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.14.26428\include\type_traits(1364): note: 參見對(duì)正在編譯的 類 模板 實(shí)例化 "std::conjunction<:is_convertible _stringviewish>>,std::negation<:is_convertible _stringviewish _elem>>>" 的引用

1> with

1> [

1> _StringViewIsh=char [2],

1> _Elem=char

1> ]

1>d:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.14.26428\include\xstring(2105): note: 查看指向正在編譯的變量模板“const bool conjunction_v<:is_convertible const> >,std::negation<:is_convertible const> > >”的引用

1>d:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.14.26428\include\xstring(3748): note: 參見對(duì)正在編譯的 別名 模板 實(shí)例化 "_Is_string_view_ish" 的引用

1>已完成生成項(xiàng)目“ormpp_test.vcxproj”的操作 - 失敗。

========== 生成: 成功 0 個(gè),失敗 1 個(gè),最新 0 個(gè),跳過 0 個(gè) ==========

無法識(shí)別long類型?

創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)

總結(jié)

以上是生活随笔為你收集整理的mysql 结构体_mysql模块使用结构体生成数据库表,不识别long类型的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。