开发者

how to split column name declarations in sql create statement?

开发者 https://www.devze.com 2023-03-20 15:47 出处:网络
I have trimmed create statement only to the column declarations: `user,id` PRIMARY KEY NOT NULL, [col,1] NOT NULL, \"another,col\" UNIQUE,

I have trimmed create statement only to the column declarations:

`user,id` PRIMARY KEY NOT NULL, [col,1] NOT NULL, "another,col" UNIQUE,
'`and`,''another'',"one"' INTEGER, and_so_on

The caveat is that commas are not only between columns declarations but may be in the column names. (Yes, I know that it is bad habit to place them into column names.)

effect should be like this:

array (
 `user,id` PRIMARY KEY NOT NULL,
 [col,1] NOT NULL,
 "another,col" UNIQUE,
 '`and`,开发者_如何学Python''another'',"one"' INTEGER,
 and_so_on
)


If you're looking to split names into components, why not use an underscore? user_id, col_1, another_col, and_another_one.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号