
How many lines of C++ does a minimal CRUD database application need? - greenrobot
Check this example; two lines for initialization, one line for each operation:<p><pre><code>    obx::Store store(create_obx_model()); 
    obx::Box&lt;Task&gt; taskBox(store);
 
    obx_id id = box.put({.text = &quot;Buy milk&quot;});  &#x2F;&#x2F; Create
    std::unique_ptr&lt;Task&gt; task = box.get(id);   &#x2F;&#x2F; Read
    if (task) {    
        task-&gt;text += &quot; &amp; some bread&quot;;
        box.put(*task);                         &#x2F;&#x2F; Update
        ...
        box.remove(id);                         &#x2F;&#x2F; Delete
    }
</code></pre>
Can it be done shorter than that?<p>PS.: the example shows user code only, there&#x27;s a tool to generate boilerplate code, e.g. the Task struct and &quot;binding&quot; it to database.
======
_448
Here is an example from Wt's DBO tutorial:
[https://www.webtoolkit.eu/wt/doc/tutorial/dbo.html](https://www.webtoolkit.eu/wt/doc/tutorial/dbo.html)

------
tcbasche
As many as is required?

This just looks like a competition ...

