after i connect to a mysql database,how can i get the table names in this db? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Steinfeld
2008-Jun-04 02:43 UTC
Re: how can i get all table names of an mysql database
mysql> show tables; On Tue, Jun 3, 2008 at 10:39 PM, tristan <sooqing-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > after i connect to a mysql database,how can i get the table names in > this db? > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
but,how can i do this using Rails? On Jun 4, 10:43 am, "Michael Steinfeld" <mikeisgr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> mysql> show tables; > > > > On Tue, Jun 3, 2008 at 10:39 PM, tristan <sooq...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > after i connect to a mysql database,how can i get the table names in > > this db?- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2008-Jun-04 03:07 UTC
Re: how can i get all table names of an mysql database
> but,how can i do this using Rails?ActiveRecord::Base.connection.tables Will return an array of all the table names.> On Jun 4, 10:43 am, "Michael Steinfeld" <mikeisgr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> mysql> show tables; >> >> >> >> On Tue, Jun 3, 2008 at 10:39 PM, tristan <sooq...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> after i connect to a mysql database,how can i get the table names in >>> this db?- Hide quoted text - >> >> - Show quoted text - > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thanks On Jun 4, 11:07 am, Philip Hallstrom <phi...-LSG90OXdqQE@public.gmane.org> wrote:> > but,how can i do this using Rails? > > ActiveRecord::Base.connection.tables > > Will return an array of all the table names. > > > > > On Jun 4, 10:43Â am, "Michael Steinfeld" <mikeisgr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> mysql> show tables; > > >> On Tue, Jun 3, 2008 at 10:39 PM, tristan <sooq...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >>> after i connect to a mysql database,how can i get the table names in > >>> this db?- Hide quoted text - > > >> - Show quoted text -- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---