@@ -300,12 +300,12 @@ Query for a property of an inner object::
300300 SELECT 1 row in set (... sec)
301301
302302
303- .. note::
304-
305- It is currently not possible to insert objects using crash. In order to do
306- that it is necessary to use one of the client libraries like
307- `crate-python`_ or use the :doc:`rest`.
303+ Inserting objects::
308304
305+ cr> insert into locations (id, name, position, kind, race)
306+ ... values ('DO', 'Dornbirn', 14, 'City', {name='Vorarlberger',
307+ ... description='Very nice people with a strange accent', interests=['mountains', 'cheese', 'enzian']});
308+ INSERT OK, 1 row affected (... sec)
309309
310310.. _sql_dml_object_arrays:
311311
@@ -331,13 +331,24 @@ Example::
331331 +-------------------+-------------------------------------------------------------------------------------------+----------------------------+
332332 SELECT 2 rows in set (... sec)
333333
334+ cr> insert into locations (id, name, position, kind, informations)
335+ ... values ('B', 'Berlin', 15, 'City', [{evolution_level=6, population=3600001}, {evolution_level=42, population=1}]);
336+ INSERT OK, 1 row affected (... sec)
337+
338+ cr> refresh table locations;
339+ REFRESH OK (... sec)
340+
334341 cr> select name from locations where 4 < ANY (informations['evolution_level']);
335342 +-------------------+
336343 | name |
337344 +-------------------+
345+ | Berlin |
338346 | North West Ripple |
339347 +-------------------+
340- SELECT 1 row in set (... sec)
348+ SELECT 2 rows in set (... sec)
349+
350+
351+
341352
342353.. _sql_dml_aggregation:
343354
@@ -406,7 +417,7 @@ Some Examples::
406417 +----------+
407418 | count(*) |
408419 +----------+
409- | 13 |
420+ | 15 |
410421 +----------+
411422 SELECT 1 row in set (... sec)
412423
@@ -426,7 +437,7 @@ Some Examples::
426437 +-------------+----------+
427438 | count(name) | count(*) |
428439 +-------------+----------+
429- | 12 | 13 |
440+ | 14 | 15 |
430441 +-------------+----------+
431442 SELECT 1 row in set (... sec)
432443
@@ -456,23 +467,25 @@ Some Examples::
456467 +----------+-------------+
457468 | count(*) | kind |
458469 +----------+-------------+
470+ | 2 | City |
459471 | 4 | Galaxy |
460472 | 5 | Planet |
461473 | 4 | Star System |
462474 +----------+-------------+
463- SELECT 3 rows in set (... sec)
475+ SELECT 4 rows in set (... sec)
464476
465477::
466478
467479 cr> select max(position), kind from locations group by kind order by max(position) desc;
468480 +---------------+-------------+
469481 | max(position) | kind |
470482 +---------------+-------------+
483+ | 15 | City |
471484 | 6 | Galaxy |
472485 | 5 | Planet |
473486 | 4 | Star System |
474487 +---------------+-------------+
475- SELECT 3 rows in set (... sec)
488+ SELECT 4 rows in set (... sec)
476489
477490::
478491
@@ -482,21 +495,23 @@ Some Examples::
482495 +------------------------------------+-------------+
483496 | | Planet |
484497 | Aldebaran | Star System |
498+ | Berlin | City |
485499 | Galactic Sector QQ7 Active J Gamma | Galaxy |
486500 +------------------------------------+-------------+
487- SELECT 3 rows in set (... sec)
501+ SELECT 4 rows in set (... sec)
488502
489503::
490504
491505 cr> select count(*), min(name), kind from locations group by kind order by kind;
492506 +----------+------------------------------------+-------------+
493507 | count(*) | min(name) | kind |
494508 +----------+------------------------------------+-------------+
509+ | 2 | Berlin | City |
495510 | 4 | Galactic Sector QQ7 Active J Gamma | Galaxy |
496511 | 5 | | Planet |
497512 | 4 | Aldebaran | Star System |
498513 +----------+------------------------------------+-------------+
499- SELECT 3 rows in set (... sec)
514+ SELECT 4 rows in set (... sec)
500515
501516::
502517
@@ -507,8 +522,9 @@ Some Examples::
507522 | 10.0 | Star System |
508523 | 13.0 | Galaxy |
509524 | 15.0 | Planet |
525+ | 29.0 | City |
510526 +---------------+-------------+
511- SELECT 3 rows in set (... sec)
527+ SELECT 4 rows in set (... sec)
512528
513529.. _sql_dml_group_by:
514530
@@ -528,8 +544,9 @@ This is useful if used in conjunction with aggregation functions::
528544 | 5 | Planet |
529545 | 4 | Galaxy |
530546 | 4 | Star System |
547+ | 2 | City |
531548 +----------+-------------+
532- SELECT 3 rows in set (... sec)
549+ SELECT 4 rows in set (... sec)
533550
534551.. note::
535552
@@ -572,8 +589,8 @@ In order to get the match score of the fulltext search, an internal system colum
572589 +-----------+------------+
573590 | name | _score |
574591 +-----------+------------+
575- | Altair | 0.56319076 |
576- | Bartledan | 0.4590714 |
592+ | Altair | 0.5965736 |
593+ | Bartledan | 0.49279192 |
577594 +-----------+------------+
578595 SELECT 2 rows in set (... sec)
579596
@@ -586,8 +603,8 @@ Of course it is possible to change it to use an ascending order instead::
586603 +-----------+------------+
587604 | name | _score |
588605 +-----------+------------+
589- | Bartledan | 0.4590714 |
590- | Altair | 0.56319076 |
606+ | Bartledan | 0.49279192 |
607+ | Altair | 0.5965736 |
591608 +-----------+------------+
592609 SELECT 2 rows in set (... sec)
593610
@@ -609,14 +626,16 @@ A negative fulltext search can be done using a ``NOT`` clause::
609626 | Alpha Centauri | 1.0 |
610627 | Allosimanius Syneca | 1.0 |
611628 | NULL | 1.0 |
629+ | Berlin | 1.0 |
612630 | North West Ripple | 1.0 |
613631 | Galactic Sector QQ7 Active J Gamma | 1.0 |
614632 | Algol | 1.0 |
615633 | Argabuthon | 1.0 |
616634 | Arkintoofle Minor | 1.0 |
617635 | | 1.0 |
636+ | Dornbirn | 1.0 |
618637 +------------------------------------+--------+
619- SELECT 11 rows in set (... sec)
638+ SELECT 13 rows in set (... sec)
620639
621640
622641Filter by :ref:`_score <sql_ddl_system_column_score>`
@@ -632,11 +651,11 @@ Anyway let's do it here for demonstration purpose::
632651
633652 cr> select name, \"_score\" from locations where match(name_description_ft, 'time')
634653 ... and \"_score\" > 0.9;
635- +--------+-----------+
636- | name | _score |
637- +--------+-----------+
638- | Altair | 0.9204767 |
639- +--------+-----------+
654+ +--------+------------ +
655+ | name | _score |
656+ +--------+------------ +
657+ | Altair | 0.93670994 |
658+ +--------+------------ +
640659 SELECT 1 row in set (... sec)
641660
642661As you maybe noticed, the :ref:`_score <sql_ddl_system_column_score>` value has changed for the
0 commit comments