pub struct Command { /* private fields */ }
Expand description

The query that will be sent to RethinkDB

Implementations

Create a table

A RethinkDB table is a collection of JSON documents.

Example

Create a table named “dc_universe” with the default settings.

r.db("heroes").table_create("dc_universe").run(conn)
   {
       "config_changes": [
           {
               "new_val": {
                   "db": "test",
                   "durability":  "hard",
                   "id": "20ea60d4-3b76-4817-8828-98a236df0297",
                   "name": "dc_universe",
                   "primary_key": "id",
                   "shards": [
                       {
                           "primary_replica": "rethinkdb_srv1",
                           "replicas": [
                               "rethinkdb_srv1",
                               "rethinkdb_srv2"
                           ]
                       }
                   ],
                   "write_acks": "majority"
               },
               "old_val": None
           }
       ],
       "tables_created": 1
   }
       ```
         

Orders the result based on the given column.

Argument can either be a string, r.asc("column") for ascending or r.desc("column") for descending. If the given argument is a string, the direction will default to ascending.

Example

Sort the result in descending order based on the created_at column.

r.db("database").table("users").order_by(r.desc("created_at")).run(conn)

Limits the result set to the given amount.

Argument can be an isize.

Example

Get 5 records.

r.db("database").table("users").limit(5).run(conn)

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the & operator.

Performs the & operation. Read more

The resulting type after applying the | operator.

Performs the | operation. Read more

The resulting type after applying the ^ operator.

Performs the ^ operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Performs the conversion.

Performs the conversion.

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the ! operator.

Performs the unary ! operation. Read more

The resulting type after applying the % operator.

Performs the % operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more