List:MySQL++« Previous MessageNext Message »
From:Королев Илья Date:November 20 2006 11:10am
Subject:Re: Problems with timestamp
View as plain text  
Query::insert declared as

        template <class T>
        Query& insert(const T& v)
        {
                reset();

                // See above comment for cast rationale 
                dynamic_cast<std::ostream&>(*this) <<
std::setprecision(16) <<
                                "INSERT INTO " << v.table() << " (" <<
                                v.field_list() << ") VALUES (" <<
                                v.value_list() << ')';
                return *this;
        }

So, I guess base class can have at least such methods
  - table()
  - field_list()
  - value_list()
  - equal_list()

Explain please, why "It doesn't have to have _any_ methods to be useful"?


В сообщении от 25 октября 2006 16:14 Warren Young написал(a):
> Королев Илья wrote:
> >>>> 5. SSQLS structures should derive from a common base class.  This
> let
> >>>> you put some useful common code in the MySQL++ library itself, but
> >>>> more importantly, it would let you make methods like
> Query::insert()
> >>>> into regular methods instead of templates.
> >>>
> >>> Give a more detailed description (example), please.
> >>
> >> What else needs to be explained?  It would be useful if all SSQLSes
> >> derived from a common base class that lives in the MySQL++ library.
> >> There's nothing more complicated than that to it.
> >
> > I mean "what do you think about interface of that common base class" :)
>
> It doesn't have to have _any_ methods to be useful.  Just the ability to
> pass it to Query::insert() and similar methods will make it useful
> enough.  If you want to get ideas for other methods it might have, try
> running some v2.1 SSQLSes through doc/ssqls-pretty
Thread
Problems with timestampКоролев Илья16 Oct
  • Re: Problems with timestampWarren Young17 Oct
    • Re: Problems with timestampКоролев Илья17 Oct
      • Re: Problems with timestampWarren Young17 Oct
        • Re: Problems with timestampКоролев Илья17 Oct
          • Re: Problems with timestampWarren Young17 Oct
            • Re: Problems with timestampКоролев Илья17 Oct
              • Re: Problems with timestampWarren Young17 Oct
                • Re: Problems with timestampКоролев Илья17 Oct
                  • Re: Problems with timestampWarren Young18 Oct
                    • Re: Problems with timestampКоролев Илья18 Oct
                      • Re: Problems with timestampWarren Young18 Oct
                        • Re: Problems with timestampКоролев Илья24 Oct
                          • Re: Problems with timestampWarren Young24 Oct
                            • Re: Problems with timestampКоролев Илья25 Oct
                              • Re: Problems with timestampWarren Young25 Oct
                                • Re: Problems with timestampКоролев Илья20 Nov
                                  • Re: Problems with timestampWarren Young20 Nov