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 > |