-
-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lua 多主键表(独立索引)生成代码问题 #132
Comments
这是已知问题,很多语言并没有内置的多key索引的支持,因此由开发者自己选择合适的实现。写一个make_index2函数就能较好达到效果。 |
那是需要自己修改代码生成的源码咯?如果是这样那我自己定制一个生成器吧。 |
我觉得没必要改源码。 你实现一个make_index函数将列表转换为你想要的索引方式即可 ,代码类似这样 function make_index(t, key1, key2)
local nt = {}
for _, v in ipairs(t) do
nt[v[key1]] = v
nt[v[key2]] = v
end
return nt
end |
了解,谢谢! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我想配置一个配置表的Id,Domain两个为独立的键,生成对应独立的map映射表,在lua的表示中,只生成上图这种list的格式,这种多主键表(独立索引)配置方式,在lua貌似不生效
The text was updated successfully, but these errors were encountered: