View previous topic :: View next topic |
Author |
Message |
Katy
Joined: 16 Jan 2007 Posts: 17
|
Posted: Tue Jan 16, 2007 23:07 Post subject: Proper table layout for NWNX4/MySQL? |
|
|
The example provided in the NWNX4 installation guide (here, in section 3.a), and the example script in Grinning Fool's MySQL (here), give slightly different column definitions for the NWNX4 table.
Which is most correct?
In particular, there are conflicts between the 'val' column (varchar(64) vs. text), the 'expire' column (smallint(5) unsigned vs. int(11)), and 'last' (timestamp(14) vs. timestamp).
Since the columns are different widths, I'm concerned that the wrong data may be stored or something might be truncated, but I don't really know enough about SQL to make an intelligent determination as to which is correct. |
|
Back to top |
|
|
Grinning Fool
Joined: 12 Feb 2005 Posts: 264
|
Posted: Tue Jan 16, 2007 23:19 Post subject: Re: Proper table layout for NWNX4/MySQL? |
|
|
Katy wrote: | The example provided in the NWNX4 installation guide (here, in section 3.a), and the example script in Grinning Fool's MySQL (here), give slightly different column definitions for the NWNX4 table.
Which is most correct?
In particular, there are conflicts between the 'val' column (varchar(64) vs. text), the 'expire' column (smallint(5) unsigned vs. int(11)), and 'last' (timestamp(14) vs. timestamp).
Since the columns are different widths, I'm concerned that the wrong data may be stored or something might be truncated, but I don't really know enough about SQL to make an intelligent determination as to which is correct. |
Good catch; I would say "text" is correct; timestamp v timestamp(14) doesn't matter. I'm not certain about "expire", as I'm not sure how the column is used. _________________ Khalidine, a NWN2 persistent world
Looking for volunteers. |
|
Back to top |
|
|
caloup
Joined: 29 Sep 2006 Posts: 59 Location: albi (france)
|
Posted: Wed Jan 17, 2007 6:12 Post subject: |
|
|
There is no official "table creation" for nwnx4 for the moment, you could modify the column according to how you're using nwnx/mysql...
I've taken the pwdata creation table in NWNX-Fast french and it work perfectly (i have tested with nwnx4)...
I will modify the documentation when an "official method" appear...
I'm not agree with grinning fool but it's "my opinion"... "varchar" could contain 255 octets while "text" 65535 octets...
it seem that varchar is faster than text and i'm not sure you will have a lot of persistent variable that could be more than 64 character...If you want to put 128 or 255, you can...
but it still my opinion...
Pap do you think about make a nwnx_buildtable that automatically create the table ? |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Thu Jan 18, 2007 1:34 Post subject: |
|
|
Yes, there should be something that can create the pwdata table. I guess it will be a function in the DB plugins, but I haven't made up my mind about this yet. I haven't thought about the table structure either... I'd use varchar for the val column, and a smallint for the expire column (it's meant to hold a variable lifetime in days, so the number won't be huge). _________________ Papillon |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|