feat: sql json
parent
4b11d080ba
commit
21617b4964
|
@ -105,7 +105,27 @@
|
|||
everything in there if you want.
|
||||
</p>
|
||||
<p>I always use MySQL json data type for extra field.</p>
|
||||
<p>JSON data type also used for dumping request, response data.</p>
|
||||
<p>JSON data type is also useful for dumping request, response data.</p>
|
||||
<ul>
|
||||
<li>
|
||||
<a
|
||||
href="https://dev.mysql.com/doc/refman/5.7/en/json.html"
|
||||
rel="nofollow"
|
||||
>For MySQL 5.7</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="https://dev.mysql.com/doc/refman/8.0/en/json.html"
|
||||
rel="nofollow"
|
||||
>For MySQL 8.0</a
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
Use <code>JSON_EXTRACT(col, '$.key') IS NULL</code> to check json field
|
||||
exist or not.
|
||||
</p>
|
||||
<h2>
|
||||
<a
|
||||
id="user-content-use-index"
|
||||
|
|
|
@ -72,9 +72,9 @@
|
|||
<a
|
||||
target="_blank"
|
||||
rel="noopener noreferrer nofollow"
|
||||
href="https://camo.githubusercontent.com/4567dca83cde7ee893659d05eff00ba7875b1afcbcccc74a6a2312311f076532/68747470733a2f2f7a656c6c696a2e6465762f646f63756d656e746174696f6e2f696d672f6f766572766965772d7374617475732d7461622d322e706e67"
|
||||
href="https://camo.githubusercontent.com/111ef656bf49621be488e4ec5e1f440aafc1264f2ccfa5c051b7c1f3a26fa7ae/68747470733a2f2f7a656c6c696a2e6465762f646f63756d656e746174696f6e2f696d672f6f766572766965772d7374617475732d7461622d322e706e67"
|
||||
><img
|
||||
src="https://camo.githubusercontent.com/4567dca83cde7ee893659d05eff00ba7875b1afcbcccc74a6a2312311f076532/68747470733a2f2f7a656c6c696a2e6465762f646f63756d656e746174696f6e2f696d672f6f766572766965772d7374617475732d7461622d322e706e67"
|
||||
src="https://camo.githubusercontent.com/111ef656bf49621be488e4ec5e1f440aafc1264f2ccfa5c051b7c1f3a26fa7ae/68747470733a2f2f7a656c6c696a2e6465762f646f63756d656e746174696f6e2f696d672f6f766572766965772d7374617475732d7461622d322e706e67"
|
||||
alt=""
|
||||
data-canonical-src="https://zellij.dev/documentation/img/overview-status-tab-2.png"
|
||||
style="max-width: 100%"
|
||||
|
|
|
@ -38,7 +38,12 @@ there if you want.
|
|||
|
||||
I always use MySQL json data type for extra field.
|
||||
|
||||
JSON data type also used for dumping request, response data.
|
||||
JSON data type is also useful for dumping request, response data.
|
||||
|
||||
- [For MySQL 5.7](https://dev.mysql.com/doc/refman/5.7/en/json.html)
|
||||
- [For MySQL 8.0](https://dev.mysql.com/doc/refman/8.0/en/json.html)
|
||||
|
||||
Use `JSON_EXTRACT(col, '$.key') IS NULL` to check json field exist or not.
|
||||
|
||||
## Use index!!!
|
||||
|
||||
|
|
Loading…
Reference in New Issue