From: Colin P. A. <co...@co...> - 2009-09-17 09:30:36
|
Does HaskellDB support identity columns (auto-incremented integers)? -- Colin Adams Preston Lancashire |
From: Justin B. <jgb...@gm...> - 2009-09-17 14:38:04
|
Not specifically. What are you looking for? On Thu, Sep 17, 2009 at 2:30 AM, Colin Paul Adams <co...@co...> wrote: > Does HaskellDB support identity columns (auto-incremented integers)? > -- > Colin Adams > Preston Lancashire > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > Haskelldb-users mailing list > Has...@li... > https://lists.sourceforge.net/lists/listinfo/haskelldb-users > |
From: Colin P. A. <co...@co...> - 2009-09-17 14:45:32
|
>>>>> "Justin" == Justin Bailey <jgb...@gm...> writes: Justin> Not specifically. What are you looking for? I want an identity column, to uniquely number the rows of a table (and use that number within the application). Justin> <co...@co...> wrote: >> Does HaskellDB support identity columns (auto-incremented >> integers)? -- Colin Adams Preston Lancashire |
From: Justin B. <jgb...@gm...> - 2009-09-17 14:54:05
|
If you want the numbers generated in Haskell, consider the 'value-supply' library on Hackage. It allows you to create a generator which you can pass around and which will generate a unique number for you, on demand. On Thu, Sep 17, 2009 at 7:45 AM, Colin Paul Adams <co...@co...> wrote: >>>>>> "Justin" == Justin Bailey <jgb...@gm...> writes: > > Justin> Not specifically. What are you looking for? > > I want an identity column, to uniquely number the rows of a table (and > use that number within the application). > > Justin> <co...@co...> wrote: > >> Does HaskellDB support identity columns (auto-incremented > >> integers)? > -- > Colin Adams > Preston Lancashire > |
From: Colin P. A. <co...@co...> - 2009-09-17 15:05:49
|
>>>>> "Justin" == Justin Bailey <jgb...@gm...> writes: Justin> If you want the numbers generated in Haskell, consider the Justin> 'value-supply' library on Hackage. It allows you to create Justin> a generator which you can pass around and which will Justin> generate a unique number for you, on demand. I suppose that might help a little. I will only have to read the existing maximum value from the table when restarting the application, instead of on every insert. Justin> On Thu, Sep 17, 2009 at 7:45 AM, Colin Paul Adams Justin> <co...@co...> wrote: >>>>>>> "Justin" == Justin Bailey <jgb...@gm...> writes: >> >> Justin> Not specifically. What are you looking for? >> >> I want an identity column, to uniquely number the rows of a >> table (and use that number within the application). >> >> Justin> <co...@co...> wrote: >> >> Does HaskellDB support identity columns (auto-incremented >> >> integers)? -- Colin Adams Preston Lancashire >> -- Colin Adams Preston Lancashire |
From: Justin B. <jgb...@gm...> - 2009-09-17 15:18:52
|
In that case I would use the database driver's support for returning auto-increment columns. You'll want to look at the specific library you are using to see how to do that. The HaskellDB interface may hide that from you - I'm not sure. You may want to use HaskellDB just to generate the appropriate SQL, which you then execute using the DB library. On Thu, Sep 17, 2009 at 8:05 AM, Colin Paul Adams <co...@co...> wrote: >>>>>> "Justin" == Justin Bailey <jgb...@gm...> writes: > > Justin> If you want the numbers generated in Haskell, consider the > Justin> 'value-supply' library on Hackage. It allows you to create > Justin> a generator which you can pass around and which will > Justin> generate a unique number for you, on demand. > > I suppose that might help a little. I will only have to read the > existing maximum value from the table when restarting the application, > instead of on every insert. > > Justin> On Thu, Sep 17, 2009 at 7:45 AM, Colin Paul Adams > Justin> <co...@co...> wrote: > >>>>>>> "Justin" == Justin Bailey <jgb...@gm...> writes: > >> > >> Justin> Not specifically. What are you looking for? > >> > >> I want an identity column, to uniquely number the rows of a > >> table (and use that number within the application). > >> > >> Justin> <co...@co...> wrote: > >> >> Does HaskellDB support identity columns (auto-incremented > >> >> integers)? -- Colin Adams Preston Lancashire > >> > > > -- > Colin Adams > Preston Lancashire > |
From: Colin P. A. <co...@co...> - 2009-09-17 15:53:29
|
>>>>> "Justin" == Justin Bailey <jgb...@gm...> writes: Justin> In that case I would use the database driver's support for Justin> returning auto-increment columns. You'll want to look at Justin> the specific library you are using to see how to do Justin> that. The HaskellDB interface may hide that from you - I'm Justin> not sure. You may want to use HaskellDB just to generate Justin> the appropriate SQL, which you then execute using the DB Justin> library. This isn't going to work. Can I get the MAX of a column using haskelldb syntax? -- Colin Adams Preston Lancashire |
From: Justin B. <jgb...@gm...> - 2009-09-17 16:04:13
|
Sure, there is a "_max" operator which you can use: http://hackage.haskell.org/packages/archive/haskelldb/0.12/doc/html/Database-HaskellDB-Query.html#v%3A_max On Thu, Sep 17, 2009 at 8:53 AM, Colin Paul Adams <co...@co...> wrote: >>>>>> "Justin" == Justin Bailey <jgb...@gm...> writes: > > Justin> In that case I would use the database driver's support for > Justin> returning auto-increment columns. You'll want to look at > Justin> the specific library you are using to see how to do > Justin> that. The HaskellDB interface may hide that from you - I'm > Justin> not sure. You may want to use HaskellDB just to generate > Justin> the appropriate SQL, which you then execute using the DB > Justin> library. > > This isn't going to work. > > Can I get the MAX of a column using haskelldb syntax? > -- > Colin Adams > Preston Lancashire > |