How can solve JSON column in H2

前端 未结 10 1900
隐瞒了意图╮
隐瞒了意图╮ 2020-12-24 13:39

I use in application MySQL 5.7 and I have JSON columns. When I try running my integration tests don\'t work because the H2 database can\'t create the table. This is the erro

10条回答
  •  滥情空心
    2020-12-24 14:12

    JSON support was added to H2 after the question was asked, with version 1.4.200 (2019-10-14).

    However, you rarely need a JSON data type in a database. JSON essentially is just a potentially very long string, so you can use CLOB which is available on most databases.

    You do need the JSON data type if you need an SQL function that operates on them, and then only if the database insists that its JSON functions operate on a JSON type instead of on a CLOB. Such functions tend to be database-dependent though.

提交回复
热议问题