On Thu, Dec 31, 2009 at 6:06 PM, Warren Young <mysqlpp@stripped> wrote:
> Actually, yes, I am working on a replacement for SSQLS for the next version
> of MySQL++. I've added a note to ensure I include copy ctors and operator=
> in the definition of an SSQLS v2 class.
>
>
Nice, I didn't hear of SSQLS v2 before.
Do you have any idea of when 3.1 will be released?
Another question:
I didn't see anything about handling the foreign keys in SSQLS v2?
I mean, for example If you have this schema:
Table person
int id
string name
Table car
int id
string model
int person_id
Generating these methods could be cool:
// Return the cars owned by the person, fetch them from the database if
needed.
std::vector<Car>& Person::cars();
// Save all the owned cars in database.
void Person::save_cars();
// Fetch all the owned cars in database.
void Person::fetch_cars();
// Associate a car to this person.
void Person::add_car(Car& c);
// Associate a car to this person (from its id).
void Person::add_car(unsigned car_id);
// Remove a car.
void Person::remove_car(Car& c);
// Remove a car (from its id).
void Person::remove_car(unsigned car_id);
// Return the person who own this car, fetch it from the database if needed.
Person& Car::person();
// Save the owner in database.
void Car::save_person();
// Fetch the owner from database.
void Car::fetch_person();
// Set the owner
void Car::set_person(Person& p);
Thanks
--
Matthieu Garrigues