Why include a SQL file when we don't use it?

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Why include a SQL file when we don't use it?

Mike Fedyk
http://vtiger.fosslabs.com/cgi-bin/trac.cgi/changeset/3833

The database is created from the adodb XML file (right?), why do we need
a SQL file in the source code?

Sure we can be flexible, but we don't want to add any support headaches
(sql file not updated on new release for instance).
_______________________________________________
This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
http://zohowriter.com/?vt 
Reply | Threaded
Open this post in threaded view
|

Re: Why include a SQL file when we don't use it?

fboudra (Bugzilla)
> http://vtiger.fosslabs.com/cgi-bin/trac.cgi/changeset/3833
>
> The database is created from the adodb XML file (right?)
don't know not documented.

> , why do we need a SQL file in the source code ?

i'm changing installation. to add a better multi-platform / multi-operating
system support for next installer / packaging issue. I want an "install and
just work" like. And an unified one for :
* vtigercrm
* vtiger'n go
* debian/ubuntu package
* vtiger addon for xampp

have you got a better way to inject database ?

* php code need user intervention and break "install and just work" idea.
* or a specific php code to inject data but for me it's like sql file
* adodb xml file ? don't know it exists, how can inject db data with this ?
software dependencies ?
* how to resolve multi db support like mysql posqtgresql oracle mssql ?

so i used a simple sql file and use sql-client as dependencie.

> Sure we can be flexible, but we don't want to add any support headaches
> (sql file not updated on new release for instance).

yes, it's more flexible and it's just a file. There's no headaches support,
just putting preliminary file for an easy way to install and update.
i'll update it as needed for now until i'll automate it.

looking initial subject : Why include a SQL file when we don't use it ?
i want to ask why include a bin directory when we don't use it ?

cheers,

Fathi
_______________________________________________
This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
http://zohowriter.com/?vt 
Reply | Threaded
Open this post in threaded view
|

Re: Why include a SQL file when we don't use it?

Allan Bush
I don't understand half of what you just said but using the adodb xml
file for database creation is one of the only thing this project does
right, please continue to use it.

The adodb xml file it designed to be cross database compatible, the
only thing it depends on is adodb which is already a requirement,
using it will save you tons of "copy and paste" code "reuse" which
just leads to bugs.

On 2/20/06, Fathi Boudra <[hidden email]> wrote:

> > http://vtiger.fosslabs.com/cgi-bin/trac.cgi/changeset/3833
> >
> > The database is created from the adodb XML file (right?)
> don't know not documented.
>
> > , why do we need a SQL file in the source code ?
>
> i'm changing installation. to add a better multi-platform / multi-operating
> system support for next installer / packaging issue. I want an "install and
> just work" like. And an unified one for :
> * vtigercrm
> * vtiger'n go
> * debian/ubuntu package
> * vtiger addon for xampp
>
> have you got a better way to inject database ?
>
> * php code need user intervention and break "install and just work" idea.
> * or a specific php code to inject data but for me it's like sql file
> * adodb xml file ? don't know it exists, how can inject db data with this ?
> software dependencies ?
> * how to resolve multi db support like mysql posqtgresql oracle mssql ?
>
> so i used a simple sql file and use sql-client as dependencie.
>
> > Sure we can be flexible, but we don't want to add any support headaches
> > (sql file not updated on new release for instance).
>
> yes, it's more flexible and it's just a file. There's no headaches support,
> just putting preliminary file for an easy way to install and update.
> i'll update it as needed for now until i'll automate it.
>
> looking initial subject : Why include a SQL file when we don't use it ?
> i want to ask why include a bin directory when we don't use it ?
>
> cheers,
>
> Fathi
> _______________________________________________
> This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
> http://zohowriter.com/?vt
>

_______________________________________________
This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
http://zohowriter.com/?vt 
Reply | Threaded
Open this post in threaded view
|

Re: Why include a SQL file when we don't use it?

Mike Fedyk
Hi Allan,

What is wanted is a way to populate the database without user
interaction like when you are installing the Debian/Ubuntu vtigercrm
package, for instance.

What is the best way to pass that information to php/adodb from the
command line?

Allan Bush wrote:

>I don't understand half of what you just said but using the adodb xml
>file for database creation is one of the only thing this project does
>right, please continue to use it.
>
>The adodb xml file it designed to be cross database compatible, the
>only thing it depends on is adodb which is already a requirement,
>using it will save you tons of "copy and paste" code "reuse" which
>just leads to bugs.
>
>On 2/20/06, Fathi Boudra <[hidden email]> wrote:
>  
>
>>>http://vtiger.fosslabs.com/cgi-bin/trac.cgi/changeset/3833
>>>
>>>The database is created from the adodb XML file (right?)
>>>      
>>>
>>don't know not documented.
>>
>>    
>>
>>>, why do we need a SQL file in the source code ?
>>>      
>>>
>>i'm changing installation. to add a better multi-platform / multi-operating
>>system support for next installer / packaging issue. I want an "install and
>>just work" like. And an unified one for :
>>* vtigercrm
>>* vtiger'n go
>>* debian/ubuntu package
>>* vtiger addon for xampp
>>
>>have you got a better way to inject database ?
>>
>>* php code need user intervention and break "install and just work" idea.
>>* or a specific php code to inject data but for me it's like sql file
>>* adodb xml file ? don't know it exists, how can inject db data with this ?
>>software dependencies ?
>>* how to resolve multi db support like mysql posqtgresql oracle mssql ?
>>
>>so i used a simple sql file and use sql-client as dependencie.
>>
>>    
>>
>>>Sure we can be flexible, but we don't want to add any support headaches
>>>(sql file not updated on new release for instance).
>>>      
>>>
>>yes, it's more flexible and it's just a file. There's no headaches support,
>>just putting preliminary file for an easy way to install and update.
>>i'll update it as needed for now until i'll automate it.
>>
>>looking initial subject : Why include a SQL file when we don't use it ?
>>i want to ask why include a bin directory when we don't use it ?
>>
>>cheers,
>>
>>Fathi
>>_______________________________________________
>>This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
>>http://zohowriter.com/?vt
>>
>>    
>>
>
>_______________________________________________
>This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
>http://zohowriter.com/?vt 
>
>  
>
_______________________________________________
This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
http://zohowriter.com/?vt 
Reply | Threaded
Open this post in threaded view
|

Re: Why include a SQL file when we don't use it?

fboudra (Bugzilla)
In reply to this post by Allan Bush
> I don't understand half of what you just said but using the adodb xml
> file for database creation is one of the only thing this project does
> right, please continue to use it.
>
> The adodb xml file it designed to be cross database compatible, the
> only thing it depends on is adodb which is already a requirement,
> using it will save you tons of "copy and paste" code "reuse" which
> just leads to bugs.

more simple that you can understand :
can you give me a simple command line that i can use to install database on
windows and linux ?

something that can replace something like :
mysql < file.sql
_______________________________________________
This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
http://zohowriter.com/?vt 
Reply | Threaded
Open this post in threaded view
|

Re: Why include a SQL file when we don't use it?

Allan Bush
In reply to this post by Mike Fedyk
Just add the queries to populate the database into the xml file like this:

<sql>
  <descr>Insert some data into the users table.</descr>
  <query>insert into users (userName) values ( 'admin' )</query>

  <query>insert into users (userName) values ( 'Joe' )</query>
</sql>

To install the database, create a simple php file (like the one in the
current installer or see here for another example
http://phplens.com/lens/adodb/docs-datadict.htm) and run it on
install: php install.php.

On 2/21/06, Mike Fedyk <[hidden email]> wrote:

> Hi Allan,
>
> What is wanted is a way to populate the database without user
> interaction like when you are installing the Debian/Ubuntu vtigercrm
> package, for instance.
>
> What is the best way to pass that information to php/adodb from the
> command line?
>
> Allan Bush wrote:
>
> >I don't understand half of what you just said but using the adodb xml
> >file for database creation is one of the only thing this project does
> >right, please continue to use it.
> >
> >The adodb xml file it designed to be cross database compatible, the
> >only thing it depends on is adodb which is already a requirement,
> >using it will save you tons of "copy and paste" code "reuse" which
> >just leads to bugs.
> >
> >On 2/20/06, Fathi Boudra <[hidden email]> wrote:
> >
> >
> >>>http://vtiger.fosslabs.com/cgi-bin/trac.cgi/changeset/3833
> >>>
> >>>The database is created from the adodb XML file (right?)
> >>>
> >>>
> >>don't know not documented.
> >>
> >>
> >>
> >>>, why do we need a SQL file in the source code ?
> >>>
> >>>
> >>i'm changing installation. to add a better multi-platform / multi-operating
> >>system support for next installer / packaging issue. I want an "install and
> >>just work" like. And an unified one for :
> >>* vtigercrm
> >>* vtiger'n go
> >>* debian/ubuntu package
> >>* vtiger addon for xampp
> >>
> >>have you got a better way to inject database ?
> >>
> >>* php code need user intervention and break "install and just work" idea.
> >>* or a specific php code to inject data but for me it's like sql file
> >>* adodb xml file ? don't know it exists, how can inject db data with this ?
> >>software dependencies ?
> >>* how to resolve multi db support like mysql posqtgresql oracle mssql ?
> >>
> >>so i used a simple sql file and use sql-client as dependencie.
> >>
> >>
> >>
> >>>Sure we can be flexible, but we don't want to add any support headaches
> >>>(sql file not updated on new release for instance).
> >>>
> >>>
> >>yes, it's more flexible and it's just a file. There's no headaches support,
> >>just putting preliminary file for an easy way to install and update.
> >>i'll update it as needed for now until i'll automate it.
> >>
> >>looking initial subject : Why include a SQL file when we don't use it ?
> >>i want to ask why include a bin directory when we don't use it ?
> >>
> >>cheers,
> >>
> >>Fathi
> >>_______________________________________________
> >>This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
> >>http://zohowriter.com/?vt
> >>
> >>
> >>
> >
> >_______________________________________________
> >This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
> >http://zohowriter.com/?vt
> >
> >
> >
> _______________________________________________
> This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
> http://zohowriter.com/?vt
>

_______________________________________________
This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
http://zohowriter.com/?vt 
Reply | Threaded
Open this post in threaded view
|

Re: Why include a SQL file when we don't use it?

fboudra (Bugzilla)
> Just add the queries to populate the database into the xml file like this:
>
> <sql>
>   <descr>Insert some data into the users table.</descr>
>   <query>insert into users (userName) values ( 'admin' )</query>
>
>   <query>insert into users (userName) values ( 'Joe' )</query>
> </sql>
>
> To install the database, create a simple php file (like the one in the
> current installer or see here for another example
> http://phplens.com/lens/adodb/docs-datadict.htm) and run it on
> install: php install.php.

what is the difference between embedding sql query in an xml file, add an
install.php to call this xml file rather call an sql file.

from my point of view the same. This isn't a technical problem but a
philosophy question.

introducing this sql seems to not be pleased. Maybe a poll on it can be asked.
anyway i use and will use the sql file for debian and ubuntu packaging.
just need to know if you (developers) wants it in source code or not.
_______________________________________________
This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
http://zohowriter.com/?vt 
Reply | Threaded
Open this post in threaded view
|

Re: Why include a SQL file when we don't use it?

Allan Bush
The difference is with a sql file you'll have one file for each
database type where 90%+ of the code is the same in all the files
verses one xml file for all database types.  It's a lot easier and
cleaner to modify one file.

On 2/21/06, Fathi BOUDRA <[hidden email]> wrote:

> > Just add the queries to populate the database into the xml file like this:
> >
> > <sql>
> >   <descr>Insert some data into the users table.</descr>
> >   <query>insert into users (userName) values ( 'admin' )</query>
> >
> >   <query>insert into users (userName) values ( 'Joe' )</query>
> > </sql>
> >
> > To install the database, create a simple php file (like the one in the
> > current installer or see here for another example
> > http://phplens.com/lens/adodb/docs-datadict.htm) and run it on
> > install: php install.php.
>
> what is the difference between embedding sql query in an xml file, add an
> install.php to call this xml file rather call an sql file.
>
> from my point of view the same. This isn't a technical problem but a
> philosophy question.
>
> introducing this sql seems to not be pleased. Maybe a poll on it can be asked.
> anyway i use and will use the sql file for debian and ubuntu packaging.
> just need to know if you (developers) wants it in source code or not.
> _______________________________________________
> This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
> http://zohowriter.com/?vt
>

_______________________________________________
This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
http://zohowriter.com/?vt 
Reply | Threaded
Open this post in threaded view
|

Re: Why include a SQL file when we don't use it?

mikecrowe
In reply to this post by fboudra (Bugzilla)
Folks,

I refer you to my post:
http://forums.vtiger.com/viewtopic.php?t=4535&highlight=

To install from command line:
        php install.php
where install.php is:
<?
require_once('config.php');
require_once('connection.php');
require_once('adodb/adodb.inc.php');
require_once('adodb/adodb-xmlschema.inc.php');

$conn = ADONewConnection($dbconfig['db_type']);
$conn->Connect($dbconfig['db_host_name'],$dbconfig['db_user_name'],
$dbconfig['db_password'],$dbconfig['db_name']);
$schema = new adoSchema( $conn );
$schema->SetUpgradeMethod('ALTER');
$schema->ExecuteInline(true);
$sql = $schema->ParseSchema( "adodb/DatabaseSchema.xml" );
?>

To create the XML file, all it takes is:
$schema = new adoSchema( $conn );
$t = $schema->ExtractSchema(true);
(now write $t to the xml file)

Mike


On Tuesday 21 February 2006 6:34 pm, Fathi BOUDRA wrote:

> > I don't understand half of what you just said but using the adodb xml
> > file for database creation is one of the only thing this project does
> > right, please continue to use it.
> >
> > The adodb xml file it designed to be cross database compatible, the
> > only thing it depends on is adodb which is already a requirement,
> > using it will save you tons of "copy and paste" code "reuse" which
> > just leads to bugs.
>
> more simple that you can understand :
> can you give me a simple command line that i can use to install database on
> windows and linux ?
>
> something that can replace something like :
> mysql < file.sql
> _______________________________________________
> This vtiger.com email is sponsored by: Zoho Writer. Are you still using
> your desktop word processor for typing documents? Try the AJAX enabled,
> collaboration-friendly online word processor, Zoho Writer for FREE instead!
> http://zohowriter.com/?vt

--
_____________________________________________________
Cheers!

Mike Crowe
Sr. Field Sales Engineer
ELCOM

3030 Naomi Dr.
Clover, SC 29710
Phone: (803) 831-9050
Fax: (704) 973-7910

[hidden email]
http://www.elcomsales.com/
_______________________________________________
This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
http://zohowriter.com/?vt 
Reply | Threaded
Open this post in threaded view
|

Re: Why include a SQL file when we don't use it?

Jeff Kowalczyk
Mike Crowe wrote:

> I refer you to my post:
> http://forums.vtiger.com/viewtopic.php?t=4535&highlight=
>
> To install from command line:
> php install.php
> where install.php is:
> <?
> require_once('config.php');
> require_once('connection.php');
> require_once('adodb/adodb.inc.php');
> require_once('adodb/adodb-xmlschema.inc.php');
>
> $conn = ADONewConnection($dbconfig['db_type']);
> $conn->Connect($dbconfig['db_host_name'],$dbconfig['db_user_name'],
> $dbconfig['db_password'],$dbconfig['db_name']);
> $schema = new adoSchema( $conn );
> $schema->SetUpgradeMethod('ALTER');
> $schema->ExecuteInline(true);
> $sql = $schema->ParseSchema( "adodb/DatabaseSchema.xml" );
> ?>
>
> To create the XML file, all it takes is:
> $schema = new adoSchema( $conn );
> $t = $schema->ExtractSchema(true);
> (now write $t to the xml file)

Thanks Mike. Can you make a trac ticket with this snippet and specifics on
where you'd like to see this fit into the install steps?

(BTW, I moved adodb/DatabaseSchema.xml to schema/DatabaseSchema.xml)
http://vtiger.fosslabs.com/cgi-bin/trac.cgi/ticket/4



_______________________________________________
This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
http://zohowriter.com/?vt 
Reply | Threaded
Open this post in threaded view
|

Re: Why include a SQL file when we don't use it?

Jeff Kowalczyk
In reply to this post by mikecrowe
Mike Crowe wrote:
> I refer you to my post:
> http://forums.vtiger.com/viewtopic.php?t=4535&highlight=

Can you repost that link? The forums say that topic id doesn't exist, even
without the &hightlight=

_______________________________________________
This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
http://zohowriter.com/?vt 
Reply | Threaded
Open this post in threaded view
|

Re: Why include a SQL file when we don't use it?

mikecrowe
In reply to this post by Jeff Kowalczyk
Here's my original post.  It was in the private forum:


Guys, time for me to get on my soapbox again!

We aren't using adodb-xmlschema to it's fullest extent. If we fix
DatabaseSchema.xml and populate with initial data, the install script
becomes:
Code:
   if ($db_populate)
      $success = $db->createTables("install/vTigerSchema.xml");
   else
      $success = $db->createTables("install/vTigerSchemaDemoData.xml");

The install script is MUCH smaller and simpler. Downside is the schema must be
created from a pristine database.

I've attached a script names install/extractInstallSchema.php. From the root
directory of the database, type in:
Code:
php install/extractTableSchema.php

The 2 tables (vTigerSchema and vTigerSchemaDemoData) will be created in the
install directory.

* vTigerSchema.xml contains all the core data of the database: fields,
profiles, users, etc. Simply make sure the system you are basing the extract
on is exactly the result you want to create.
* vTigerSchemaDemoData.xml additionally exports the contents of all the "data"
of the system, such as Accounts, Contacts, etc.

I would ideally like to break this down even more, but only if everybody
agrees: Each module (such as Accounts) would have each a schema file such as
AccountsSchema.xml, and thereby become independent. We could even get to the
point where modules are installed dynamically. This is a feature which I've
added to Vip, but I haven't fully tested this portion (of Vip -- I have of
this install script).

I really think this is a better way to do it, but what do I really know? Very
Happy

Have a look, review, and please comment.


On Tuesday 21 February 2006 8:34 pm, Jeff Kowalczyk wrote:

> Mike Crowe wrote:
> > I refer you to my post:
> > http://forums.vtiger.com/viewtopic.php?t=4535&highlight=
> >
> > To install from command line:
> > php install.php
> > where install.php is:
> > <?
> > require_once('config.php');
> > require_once('connection.php');
> > require_once('adodb/adodb.inc.php');
> > require_once('adodb/adodb-xmlschema.inc.php');
> >
> > $conn = ADONewConnection($dbconfig['db_type']);
> > $conn->Connect($dbconfig['db_host_name'],$dbconfig['db_user_name'],
> > $dbconfig['db_password'],$dbconfig['db_name']);
> > $schema = new adoSchema( $conn );
> > $schema->SetUpgradeMethod('ALTER');
> > $schema->ExecuteInline(true);
> > $sql = $schema->ParseSchema( "adodb/DatabaseSchema.xml" );
> > ?>
> >
> > To create the XML file, all it takes is:
> > $schema = new adoSchema( $conn );
> > $t = $schema->ExtractSchema(true);
> > (now write $t to the xml file)
>
> Thanks Mike. Can you make a trac ticket with this snippet and specifics on
> where you'd like to see this fit into the install steps?
>
> (BTW, I moved adodb/DatabaseSchema.xml to schema/DatabaseSchema.xml)
> http://vtiger.fosslabs.com/cgi-bin/trac.cgi/ticket/4
>
>
>
> _______________________________________________
> This vtiger.com email is sponsored by: Zoho Writer. Are you still using
> your desktop word processor for typing documents? Try the AJAX enabled,
> collaboration-friendly online word processor, Zoho Writer for FREE instead!
> http://zohowriter.com/?vt
--
_____________________________________________________
Cheers!

Mike Crowe
Sr. Field Sales Engineer
ELCOM

3030 Naomi Dr.
Clover, SC 29710
Phone: (803) 831-9050
Fax: (704) 973-7910

[hidden email]
http://www.elcomsales.com/

install.zip (57K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Why include a SQL file when we don't use it?

Jeff Kowalczyk
http://vtiger.fosslabs.com/cgi-bin/trac.cgi/ticket/28

"use adodb schema to install database schema on multiple backends, avoid
.sql files"



_______________________________________________
This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
http://zohowriter.com/?vt 
Reply | Threaded
Open this post in threaded view
|

Re: Why include a SQL file when we don't use it?

Michel JACQUEMES
I have followed with some interest mails on this subject. Having worked a
bit on MsSQL implementation, I will say that use of adodb is probably
better. But doing so you solve multi bases installation but what you install
won't work.
You have to change the code everywhere to avoid static or dynamic queries
builds which are not compatible with other databases. I am not experienced
enough with adodb to say if GetInsertSQL, GetUpdateSQl, GenID and Insert_ID
can solve the problem.

Another way could be to implement something looking like language support,
having subdirectories for each databse and the convenient code in them.

Having a bit of experience on Delphi and object Pascal, I could also suggest
to use a datasource object in charge of the interface between displaying
data and database access. But maybe that adodb do that anyway.

Michel

-----Message d'origine-----
De : [hidden email]
[mailto:[hidden email]] De la part de Jeff
Kowalczyk
Envoyé : mercredi 22 février 2006 14:52
À : [hidden email]
Objet : Re: [Vtigercrm-developers] Why include a SQL file when we don't use
it?

http://vtiger.fosslabs.com/cgi-bin/trac.cgi/ticket/28

"use adodb schema to install database schema on multiple backends, avoid
.sql files"



_______________________________________________
This vtiger.com email is sponsored by: Zoho Writer. Are you still using your
desktop word processor for typing documents? Try the AJAX enabled,
collaboration-friendly online word processor, Zoho Writer for FREE instead!
http://zohowriter.com/?vt 


_______________________________________________
This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
http://zohowriter.com/?vt 
Reply | Threaded
Open this post in threaded view
|

Re: Why include a SQL file when we don't use it?

Sergio A. Kessler-2
In reply to this post by mikecrowe
mike is rigth that the adodb schema has advantages over sql files, but
I also understand fathi problems WRT packaging

maybe something like this can be done:

php generate_sql.php mysql > vtiger-mysql.sql

and eventually:
php generate_sql.php pgsql > vtiger-pgsql.sql

??

so all the sql files are automatically created ?


On 2/21/06, Mike Crowe <[hidden email]> wrote:

> Folks,
>
> I refer you to my post:
> http://forums.vtiger.com/viewtopic.php?t=4535&highlight=
>
> To install from command line:
>         php install.php
> where install.php is:
> <?
> require_once('config.php');
> require_once('connection.php');
> require_once('adodb/adodb.inc.php');
> require_once('adodb/adodb-xmlschema.inc.php');
>
> $conn = ADONewConnection($dbconfig['db_type']);
> $conn->Connect($dbconfig['db_host_name'],$dbconfig['db_user_name'],
> $dbconfig['db_password'],$dbconfig['db_name']);
> $schema = new adoSchema( $conn );
> $schema->SetUpgradeMethod('ALTER');
> $schema->ExecuteInline(true);
> $sql = $schema->ParseSchema( "adodb/DatabaseSchema.xml" );
> ?>
>
> To create the XML file, all it takes is:
> $schema = new adoSchema( $conn );
> $t = $schema->ExtractSchema(true);
> (now write $t to the xml file)
>
> Mike
>
>
> On Tuesday 21 February 2006 6:34 pm, Fathi BOUDRA wrote:
> > > I don't understand half of what you just said but using the adodb xml
> > > file for database creation is one of the only thing this project does
> > > right, please continue to use it.
> > >
> > > The adodb xml file it designed to be cross database compatible, the
> > > only thing it depends on is adodb which is already a requirement,
> > > using it will save you tons of "copy and paste" code "reuse" which
> > > just leads to bugs.
> >
> > more simple that you can understand :
> > can you give me a simple command line that i can use to install database on
> > windows and linux ?
> >
> > something that can replace something like :
> > mysql < file.sql
> > _______________________________________________
> > This vtiger.com email is sponsored by: Zoho Writer. Are you still using
> > your desktop word processor for typing documents? Try the AJAX enabled,
> > collaboration-friendly online word processor, Zoho Writer for FREE instead!
> > http://zohowriter.com/?vt
>
> --
> _____________________________________________________
> Cheers!
>
> Mike Crowe
> Sr. Field Sales Engineer
> ELCOM
>
> 3030 Naomi Dr.
> Clover, SC 29710
> Phone: (803) 831-9050
> Fax: (704) 973-7910
>
> [hidden email]
> http://www.elcomsales.com/
> _______________________________________________
> This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
> http://zohowriter.com/?vt
>

_______________________________________________
This vtiger.com email is sponsored by: Zoho Writer. Are you still using your desktop word processor for typing documents? Try the AJAX enabled, collaboration-friendly online word processor, Zoho Writer for FREE instead!
http://zohowriter.com/?vt