@@ -923,39 +923,36 @@ You can parse this output to make form fields show up with a red border and thei
923
923
#### Validation types
924
924
925
925
The default types validations return the following error messages:
926
- | error message | applies to types |
927
- | ---- | ---- |
928
- | cannot be null | any non-nullable column |
929
- | must be numeric | integer bigint |
930
- | exceeds range | integer bigint |
931
- | too long | varchar varbinary |
932
- | not a float | decimal float double |
933
- | not a valid boolean | boolean |
934
- | invalid date format use yyyy-mm-dd | date timestamp |
935
- | not a valid date | date timestamp |
936
- | invalid time format use hh:mm: ss | time timestamp |
937
- | non-numeric time value | time timestamp |
938
- | not a valid time | time timestamp |
939
- | invalid timestamp format use yyyy-mm-dd hh:mm: ss | timestamp |
940
-
941
- If you want the types validation to apply to all the types, you must activate the ` validation ` middleware.
926
+
927
+ | error message | reason | applies to types |
928
+ | ------------------- | --------------------------- | ------------------------------------------- |
929
+ | cannot be null | unexpected null value | (any non-nullable column) |
930
+ | illegal whitespace | leading/trailing whitespace | integer bigint decimal float double boolean |
931
+ | invalid integer | illegal characters | integer bigint |
932
+ | string too long | too many characters | varchar varbinary |
933
+ | invalid decimal | illegal characters | decimal |
934
+ | decimal too large | too many digits before dot | decimal |
935
+ | decimal too precise | too many digits after dot | decimal |
936
+ | invalid float | illegal characters | float double |
937
+ | invalid boolean | use 1, 0, true or false | boolean |
938
+ | invalid date | use yyyy-mm-dd | date |
939
+ | invalid time | use hh:mm: ss | time |
940
+ | invalid timestamp | use yyyy-mm-dd hh:mm: ss | timestamp |
941
+
942
+ If you want the types validation to apply to all the types, you must activate the "` validation ` " middleware.
942
943
By default, all types are enabled. Which is equivalent to the two configuration possibilities:
943
944
944
945
'validation.types' => 'all',
945
946
946
947
or
947
-
948
- 'validation.types'=> 'integer,bigint,varchar,decimal,float,double,boolean,date,time,timestamp,clob,blob,varbinary,geometry',
949
948
950
- Types with no declared error message can be checked whether null when the column is non-nullable.
949
+ 'validation.types'=> 'integer,bigint,varchar,decimal,float,double,boolean,date,time,timestamp,clob,blob,varbinary,geometry',
951
950
952
- In case you want to use a validation handler but don't want any types validation, use either :
951
+ In case you want to use a validation handler but don't want any types validation, use:
953
952
954
953
'validation.types' => '',
955
-
956
- or
957
-
958
- 'validation.types'=> 'none',
954
+
955
+ NB: Types that are enabled will be checked for null values when the column is non-nullable.
959
956
960
957
### Multi-tenancy support
961
958
@@ -1211,10 +1208,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
1211
1208
[3/4] Starting SQLServer 2017 ... skipped
1212
1209
[4/4] Cloning PHP-CRUD-API v2 ... skipped
1213
1210
------------------------------------------------
1214
- mysql: 104 tests ran in 2869 ms, 1 skipped, 0 failed
1215
- pgsql: 104 tests ran in 850 ms, 1 skipped, 0 failed
1211
+ mysql: 105 tests ran in 2986 ms, 1 skipped, 0 failed
1212
+ pgsql: 105 tests ran in 976 ms, 1 skipped, 0 failed
1216
1213
sqlsrv: skipped, driver not loaded
1217
- sqlite: 104 tests ran in 883 ms, 12 skipped, 0 failed
1214
+ sqlite: 105 tests ran in 933 ms, 12 skipped, 0 failed
1218
1215
================================================
1219
1216
Debian 10 (PHP 7.3)
1220
1217
================================================
@@ -1223,10 +1220,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
1223
1220
[3/4] Starting SQLServer 2017 ... skipped
1224
1221
[4/4] Cloning PHP-CRUD-API v2 ... skipped
1225
1222
------------------------------------------------
1226
- mysql: 104 tests ran in 3056 ms, 1 skipped, 0 failed
1227
- pgsql: 104 tests ran in 869 ms, 1 skipped, 0 failed
1223
+ mysql: 105 tests ran in 3214 ms, 1 skipped, 0 failed
1224
+ pgsql: 105 tests ran in 904 ms, 1 skipped, 0 failed
1228
1225
sqlsrv: skipped, driver not loaded
1229
- sqlite: 104 tests ran in 891 ms, 12 skipped, 0 failed
1226
+ sqlite: 105 tests ran in 1145 ms, 12 skipped, 0 failed
1230
1227
================================================
1231
1228
Debian 9 (PHP 7.0)
1232
1229
================================================
@@ -1235,10 +1232,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
1235
1232
[3/4] Starting SQLServer 2017 ... skipped
1236
1233
[4/4] Cloning PHP-CRUD-API v2 ... skipped
1237
1234
------------------------------------------------
1238
- mysql: 104 tests ran in 2800 ms, 1 skipped, 0 failed
1239
- pgsql: 104 tests ran in 867 ms, 1 skipped, 0 failed
1235
+ mysql: 105 tests ran in 2940 ms, 1 skipped, 0 failed
1236
+ pgsql: 105 tests ran in 992 ms, 1 skipped, 0 failed
1240
1237
sqlsrv: skipped, driver not loaded
1241
- sqlite: 104 tests ran in 1051 ms, 12 skipped, 0 failed
1238
+ sqlite: 105 tests ran in 1063 ms, 12 skipped, 0 failed
1242
1239
================================================
1243
1240
Ubuntu 16.04 (PHP 7.0)
1244
1241
================================================
@@ -1247,9 +1244,9 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
1247
1244
[3/4] Starting SQLServer 2017 ... done
1248
1245
[4/4] Cloning PHP-CRUD-API v2 ... skipped
1249
1246
------------------------------------------------
1250
- mysql: 104 tests ran in 2789 ms, 1 skipped, 0 failed
1251
- pgsql: 104 tests ran in 872 ms, 1 skipped, 0 failed
1252
- sqlsrv: 104 tests ran in 7728 ms, 1 skipped, 0 failed
1247
+ mysql: 105 tests ran in 3015 ms, 1 skipped, 0 failed
1248
+ pgsql: 105 tests ran in 992 ms, 1 skipped, 0 failed
1249
+ sqlsrv: 105 tests ran in 10515 ms, 1 skipped, 0 failed
1253
1250
sqlite: skipped, driver not loaded
1254
1251
================================================
1255
1252
Ubuntu 18.04 (PHP 7.2)
@@ -1259,10 +1256,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
1259
1256
[3/4] Starting SQLServer 2017 ... skipped
1260
1257
[4/4] Cloning PHP-CRUD-API v2 ... skipped
1261
1258
------------------------------------------------
1262
- mysql: 104 tests ran in 3282 ms, 1 skipped, 0 failed
1263
- pgsql: 104 tests ran in 856 ms, 1 skipped, 0 failed
1259
+ mysql: 105 tests ran in 3390 ms, 1 skipped, 0 failed
1260
+ pgsql: 105 tests ran in 936 ms, 1 skipped, 0 failed
1264
1261
sqlsrv: skipped, driver not loaded
1265
- sqlite: 104 tests ran in 972 ms, 12 skipped, 0 failed
1262
+ sqlite: 105 tests ran in 1063 ms, 12 skipped, 0 failed
1266
1263
================================================
1267
1264
Ubuntu 20.04 (PHP 7.3)
1268
1265
================================================
@@ -1271,10 +1268,10 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
1271
1268
[3/4] Starting SQLServer 2017 ... skipped
1272
1269
[4/4] Cloning PHP-CRUD-API v2 ... skipped
1273
1270
------------------------------------------------
1274
- mysql: 104 tests ran in 5996 ms, 1 skipped, 0 failed
1275
- pgsql: 104 tests ran in 942 ms, 1 skipped, 0 failed
1271
+ mysql: 105 tests ran in 6434 ms, 1 skipped, 0 failed
1272
+ pgsql: 105 tests ran in 979 ms, 1 skipped, 0 failed
1276
1273
sqlsrv: skipped, driver not loaded
1277
- sqlite: 104 tests ran in 961 ms, 12 skipped, 0 failed
1274
+ sqlite: 105 tests ran in 1373 ms, 12 skipped, 0 failed
1278
1275
1279
1276
The above test run (including starting up the databases) takes less than 5 minutes on my slow laptop.
1280
1277
@@ -1294,10 +1291,10 @@ The above test run (including starting up the databases) takes less than 5 minut
1294
1291
[3/4] Starting SQLServer 2017 ... skipped
1295
1292
[4/4] Cloning PHP-CRUD-API v2 ... skipped
1296
1293
------------------------------------------------
1297
- mysql: 104 tests ran in 3282 ms, 1 skipped, 0 failed
1298
- pgsql: 104 tests ran in 856 ms, 1 skipped, 0 failed
1294
+ mysql: 105 tests ran in 3390 ms, 1 skipped, 0 failed
1295
+ pgsql: 105 tests ran in 936 ms, 1 skipped, 0 failed
1299
1296
sqlsrv: skipped, driver not loaded
1300
- sqlite: 104 tests ran in 972 ms, 12 skipped, 0 failed
1297
+ sqlite: 105 tests ran in 1063 ms, 12 skipped, 0 failed
1301
1298
root@b7ab9472e08f:/php-crud-api#
1302
1299
1303
1300
As you can see the "run.sh" script gives you access to a prompt in a chosen the docker environment.
0 commit comments