Thane Michael wrote:
> I've been searching for a way to serialize an object's vector using sqlite3
> but are yet find a working solution.

The question is how to model the vector in the database.

In most cases, you should normalize your tables:

    class A
    {
        int id;
        double something;
        vector<B> bs;
    };

    CREATE TABLE A (
        id INTEGER PRIMARY KEY,
        something REAL,
        [...]
    );
    CREATE TABLE B (
        [...],
        A_id INTEGER REFERENCES A(id)
    );

> A second question I have is whether it is possible to serialize an object
> which doesn't have attributes.

    CREATE TABLE A (
        id INTEGER PRIMARY KEY,
        something REAL,
        number_of_bs INTEGER
    );
    -- no table B


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to