Petit SQL Parser

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Petit SQL Parser

Fabrizio Perin
Hi all,
i did implement an SQL parser using Petit Parser. I toke the grammar specification from SQLite http://www.sqlite.org/lang.html . The grammar implemented is not complete, for now i did implement "just" the create table statement, it means that you should be able to parse at least a script for create the database.


To download it you can evaluate this:

Gofer new
	squeaksource: 'PetitSQLParser';					
	package: 'ConfigurationOfPetitSQLParser';				
	load.								
(Smalltalk at: #ConfigurationOfPetitSQLParser) perform: #loadDefault
in the repository there are several packages: the core contains the parser for the grammar. 

In the package parser there is a parser that instantiate some draft objects representing relational elements.

In the next future i will start to implement also other statements. 

If you start to use it and you have some problem please let me know.

Cheers,

Fabrizio


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Petit SQL Parser

Tudor Girba
That is cool news. I will take a look in the following days.

Cheers,
Doru


On 30 Aug 2010, at 16:00, Fabrizio Perin wrote:

> Hi all,
> i did implement an SQL parser using Petit Parser. I toke the grammar  
> specification from SQLite http://www.sqlite.org/lang.html . The  
> grammar implemented is not complete, for now i did implement "just"  
> the create table statement, it means that you should be able to  
> parse at least a script for create the database.
>
> The code is in squeaksource http://www.squeaksource.com/@09zbthA-fDDfyUNQ/_OIex3aA 
>  .
>
> To download it you can evaluate this:
>
> Gofer new
> squeaksource: 'PetitSQLParser';
> package: 'ConfigurationOfPetitSQLParser';
> load.
> (Smalltalk at: #ConfigurationOfPetitSQLParser) perform: #loadDefault
> in the repository there are several packages: the core contains the  
> parser for the grammar.
>
> In the package parser there is a parser that instantiate some draft  
> objects representing relational elements.
>
> In the next future i will start to implement also other statements.
>
> If you start to use it and you have some problem please let me know.
>
> Cheers,
>
> Fabrizio
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"No matter how many recipes we know, we still value a chef."






_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Petit SQL Parser

Mariano Martinez Peck
Sorry for my completely ignorance, but what can be the use of parsing SQL?

Suppose from the point of view of a database driver that receives queries, or from a ORM point of view....does it make sense for something?

Thanks

Mariano

On Tue, Aug 31, 2010 at 12:59 AM, Tudor Girba <[hidden email]> wrote:
That is cool news. I will take a look in the following days.

Cheers,
Doru



On 30 Aug 2010, at 16:00, Fabrizio Perin wrote:

Hi all,
i did implement an SQL parser using Petit Parser. I toke the grammar specification from SQLite http://www.sqlite.org/lang.html . The grammar implemented is not complete, for now i did implement "just" the create table statement, it means that you should be able to parse at least a script for create the database.

The code is in squeaksource http://www.squeaksource.com/@09zbthA-fDDfyUNQ/_OIex3aA .

To download it you can evaluate this:

Gofer new
       squeaksource: 'PetitSQLParser';                                
       package: 'ConfigurationOfPetitSQLParser';                              
       load.                                                          
(Smalltalk at: #ConfigurationOfPetitSQLParser) perform: #loadDefault
in the repository there are several packages: the core contains the parser for the grammar.

In the package parser there is a parser that instantiate some draft objects representing relational elements.

In the next future i will start to implement also other statements.

If you start to use it and you have some problem please let me know.

Cheers,

Fabrizio

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"No matter how many recipes we know, we still value a chef."






_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Petit SQL Parser

Tudor Girba
It is useful when you want to understand a database and possibly it's  
relationship with code.

For example, an SQL query in the string of some Java code that refers  
to a certain table creates a logical dependency. If we can relate the  
two worlds, we can build larger analyses.

Does it make better sense now?

Doru


On 31 Aug 2010, at 07:16, Mariano Martinez Peck wrote:

> Sorry for my completely ignorance, but what can be the use of  
> parsing SQL?
>
> Suppose from the point of view of a database driver that receives  
> queries, or from a ORM point of view....does it make sense for  
> something?
>
> Thanks
>
> Mariano
>
> On Tue, Aug 31, 2010 at 12:59 AM, Tudor Girba  
> <[hidden email]> wrote:
> That is cool news. I will take a look in the following days.
>
> Cheers,
> Doru
>
>
>
> On 30 Aug 2010, at 16:00, Fabrizio Perin wrote:
>
> Hi all,
> i did implement an SQL parser using Petit Parser. I toke the grammar  
> specification from SQLite http://www.sqlite.org/lang.html . The  
> grammar implemented is not complete, for now i did implement "just"  
> the create table statement, it means that you should be able to  
> parse at least a script for create the database.
>
> The code is in squeaksource http://www.squeaksource.com/@09zbthA-fDDfyUNQ/_OIex3aA 
>  .
>
> To download it you can evaluate this:
>
> Gofer new
>        squeaksource: 'PetitSQLParser';
>        package: 'ConfigurationOfPetitSQLParser';
>        load.
> (Smalltalk at: #ConfigurationOfPetitSQLParser) perform: #loadDefault
> in the repository there are several packages: the core contains the  
> parser for the grammar.
>
> In the package parser there is a parser that instantiate some draft  
> objects representing relational elements.
>
> In the next future i will start to implement also other statements.
>
> If you start to use it and you have some problem please let me know.
>
> Cheers,
>
> Fabrizio
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> www.tudorgirba.com
>
> "No matter how many recipes we know, we still value a chef."
>
>
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"What is more important: To be happy, or to make happy?"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Petit SQL Parser

Mariano Martinez Peck


On Tue, Aug 31, 2010 at 7:36 AM, Tudor Girba <[hidden email]> wrote:
It is useful when you want to understand a database and possibly it's relationship with code.

For example, an SQL query in the string of some Java code that refers to a certain table creates a logical dependency. If we can relate the two worlds, we can build larger analyses.

Does it make better sense now?


Yes. I think that yes :)

I was thinking more from a database driver point of view, not from visualization. Sorry, I forgot this was moose hahhaha

 
Doru



On 31 Aug 2010, at 07:16, Mariano Martinez Peck wrote:

Sorry for my completely ignorance, but what can be the use of parsing SQL?

Suppose from the point of view of a database driver that receives queries, or from a ORM point of view....does it make sense for something?

Thanks

Mariano

On Tue, Aug 31, 2010 at 12:59 AM, Tudor Girba <[hidden email]> wrote:
That is cool news. I will take a look in the following days.

Cheers,
Doru



On 30 Aug 2010, at 16:00, Fabrizio Perin wrote:

Hi all,
i did implement an SQL parser using Petit Parser. I toke the grammar specification from SQLite http://www.sqlite.org/lang.html . The grammar implemented is not complete, for now i did implement "just" the create table statement, it means that you should be able to parse at least a script for create the database.

The code is in squeaksource http://www.squeaksource.com/@09zbthA-fDDfyUNQ/_OIex3aA .

To download it you can evaluate this:

Gofer new
      squeaksource: 'PetitSQLParser';
      package: 'ConfigurationOfPetitSQLParser';
      load.
(Smalltalk at: #ConfigurationOfPetitSQLParser) perform: #loadDefault
in the repository there are several packages: the core contains the parser for the grammar.

In the package parser there is a parser that instantiate some draft objects representing relational elements.

In the next future i will start to implement also other statements.

If you start to use it and you have some problem please let me know.

Cheers,

Fabrizio

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"No matter how many recipes we know, we still value a chef."






_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"What is more important: To be happy, or to make happy?"


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Petit SQL Parser

Fabrizio Perin
Hi Marian,
here there is an example:

the one on the top is a class instead the one on the bottom is the database table that the class access.

This is a small example about what you can do by having information about the code and the database in the same model.

Cheers,

Fabrizio

On 1 Sep 2010, at 14:18, Mariano Martinez Peck wrote:



On Tue, Aug 31, 2010 at 7:36 AM, Tudor Girba <[hidden email]> wrote:
It is useful when you want to understand a database and possibly it's relationship with code.

For example, an SQL query in the string of some Java code that refers to a certain table creates a logical dependency. If we can relate the two worlds, we can build larger analyses.

Does it make better sense now?


Yes. I think that yes :)

I was thinking more from a database driver point of view, not from visualization. Sorry, I forgot this was moose hahhaha

 
Doru



On 31 Aug 2010, at 07:16, Mariano Martinez Peck wrote:

Sorry for my completely ignorance, but what can be the use of parsing SQL?

Suppose from the point of view of a database driver that receives queries, or from a ORM point of view....does it make sense for something?

Thanks

Mariano

On Tue, Aug 31, 2010 at 12:59 AM, Tudor Girba <[hidden email]> wrote:
That is cool news. I will take a look in the following days.

Cheers,
Doru



On 30 Aug 2010, at 16:00, Fabrizio Perin wrote:

Hi all,
i did implement an SQL parser using Petit Parser. I toke the grammar specification from SQLite http://www.sqlite.org/lang.html . The grammar implemented is not complete, for now i did implement "just" the create table statement, it means that you should be able to parse at least a script for create the database.

The code is in squeaksource http://www.squeaksource.com/@09zbthA-fDDfyUNQ/_OIex3aA .

To download it you can evaluate this:

Gofer new
      squeaksource: 'PetitSQLParser';
      package: 'ConfigurationOfPetitSQLParser';
      load.
(Smalltalk at: #ConfigurationOfPetitSQLParser) perform: #loadDefault
in the repository there are several packages: the core contains the parser for the grammar.

In the package parser there is a parser that instantiate some draft objects representing relational elements.

In the next future i will start to implement also other statements.

If you start to use it and you have some problem please let me know.

Cheers,

Fabrizio

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"No matter how many recipes we know, we still value a chef."






_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"What is more important: To be happy, or to make happy?"


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Petit SQL Parser

Mariano Martinez Peck


On Wed, Sep 1, 2010 at 3:39 PM, Fabrizio Perin <[hidden email]> wrote:
Hi Marian,
here there is an example:

the one on the top is a class instead the one on the bottom is the database table that the class access.

This is a small example about what you can do by having information about the code and the database in the same model.

Thanks Fabrizio. I got it.

I think it would be cool to visualize the problem while maping inheritance chain and tables, and the different solutions: one table for each subclass, one big table with NULLable fields and a type field, etc.....

 

 

Cheers,

Fabrizio

On 1 Sep 2010, at 14:18, Mariano Martinez Peck wrote:



On Tue, Aug 31, 2010 at 7:36 AM, Tudor Girba <[hidden email]> wrote:
It is useful when you want to understand a database and possibly it's relationship with code.

For example, an SQL query in the string of some Java code that refers to a certain table creates a logical dependency. If we can relate the two worlds, we can build larger analyses.

Does it make better sense now?


Yes. I think that yes :)

I was thinking more from a database driver point of view, not from visualization. Sorry, I forgot this was moose hahhaha

 
Doru



On 31 Aug 2010, at 07:16, Mariano Martinez Peck wrote:

Sorry for my completely ignorance, but what can be the use of parsing SQL?

Suppose from the point of view of a database driver that receives queries, or from a ORM point of view....does it make sense for something?

Thanks

Mariano

On Tue, Aug 31, 2010 at 12:59 AM, Tudor Girba <[hidden email]> wrote:
That is cool news. I will take a look in the following days.

Cheers,
Doru



On 30 Aug 2010, at 16:00, Fabrizio Perin wrote:

Hi all,
i did implement an SQL parser using Petit Parser. I toke the grammar specification from SQLite http://www.sqlite.org/lang.html . The grammar implemented is not complete, for now i did implement "just" the create table statement, it means that you should be able to parse at least a script for create the database.

The code is in squeaksource http://www.squeaksource.com/@09zbthA-fDDfyUNQ/_OIex3aA .

To download it you can evaluate this:

Gofer new
      squeaksource: 'PetitSQLParser';
      package: 'ConfigurationOfPetitSQLParser';
      load.
(Smalltalk at: #ConfigurationOfPetitSQLParser) perform: #loadDefault
in the repository there are several packages: the core contains the parser for the grammar.

In the package parser there is a parser that instantiate some draft objects representing relational elements.

In the next future i will start to implement also other statements.

If you start to use it and you have some problem please let me know.

Cheers,

Fabrizio

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"No matter how many recipes we know, we still value a chef."






_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"What is more important: To be happy, or to make happy?"


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Petit SQL Parser

Mariano Martinez Peck
Hi Fabrizio. Any progress on this front ?
did someone do any kind of visualization once the parser was done?

thanks

mariano

On Wed, Sep 1, 2010 at 3:46 PM, Mariano Martinez Peck <[hidden email]> wrote:


On Wed, Sep 1, 2010 at 3:39 PM, Fabrizio Perin <[hidden email]> wrote:
Hi Marian,
here there is an example:

the one on the top is a class instead the one on the bottom is the database table that the class access.

This is a small example about what you can do by having information about the code and the database in the same model.

Thanks Fabrizio. I got it.

I think it would be cool to visualize the problem while maping inheritance chain and tables, and the different solutions: one table for each subclass, one big table with NULLable fields and a type field, etc.....

 

 

Cheers,

Fabrizio

On 1 Sep 2010, at 14:18, Mariano Martinez Peck wrote:



On Tue, Aug 31, 2010 at 7:36 AM, Tudor Girba <[hidden email]> wrote:
It is useful when you want to understand a database and possibly it's relationship with code.

For example, an SQL query in the string of some Java code that refers to a certain table creates a logical dependency. If we can relate the two worlds, we can build larger analyses.

Does it make better sense now?


Yes. I think that yes :)

I was thinking more from a database driver point of view, not from visualization. Sorry, I forgot this was moose hahhaha

 
Doru



On 31 Aug 2010, at 07:16, Mariano Martinez Peck wrote:

Sorry for my completely ignorance, but what can be the use of parsing SQL?

Suppose from the point of view of a database driver that receives queries, or from a ORM point of view....does it make sense for something?

Thanks

Mariano

On Tue, Aug 31, 2010 at 12:59 AM, Tudor Girba <[hidden email]> wrote:
That is cool news. I will take a look in the following days.

Cheers,
Doru



On 30 Aug 2010, at 16:00, Fabrizio Perin wrote:

Hi all,
i did implement an SQL parser using Petit Parser. I toke the grammar specification from SQLite http://www.sqlite.org/lang.html . The grammar implemented is not complete, for now i did implement "just" the create table statement, it means that you should be able to parse at least a script for create the database.

The code is in squeaksource http://www.squeaksource.com/@09zbthA-fDDfyUNQ/_OIex3aA .

To download it you can evaluate this:

Gofer new
      squeaksource: 'PetitSQLParser';
      package: 'ConfigurationOfPetitSQLParser';
      load.
(Smalltalk at: #ConfigurationOfPetitSQLParser) perform: #loadDefault
in the repository there are several packages: the core contains the parser for the grammar.

In the package parser there is a parser that instantiate some draft objects representing relational elements.

In the next future i will start to implement also other statements.

If you start to use it and you have some problem please let me know.

Cheers,

Fabrizio

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"No matter how many recipes we know, we still value a chef."






_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"What is more important: To be happy, or to make happy?"


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev





--
Mariano
http://marianopeck.wordpress.com


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Petit SQL Parser

Fabrizio Perin
Hi Mariano,
well i did improve the parser itself adding also the alter table statement and the select statement. I did also modify the architecture: now the parser generate AST nodes instead the old "draft objects" abstraction. Anyway, as far as i remember, no one attempt to implement any visualization on that. Do you have something in your mind?

Cheers,
Fabrizio

On 11 May 2011, at 01:01, Mariano Martinez Peck wrote:

Hi Fabrizio. Any progress on this front ?
did someone do any kind of visualization once the parser was done?

thanks

mariano

On Wed, Sep 1, 2010 at 3:46 PM, Mariano Martinez Peck <[hidden email]> wrote:


On Wed, Sep 1, 2010 at 3:39 PM, Fabrizio Perin <[hidden email]> wrote:
Hi Marian,
here there is an example:
<Example.png>

the one on the top is a class instead the one on the bottom is the database table that the class access.

This is a small example about what you can do by having information about the code and the database in the same model.

Thanks Fabrizio. I got it.

I think it would be cool to visualize the problem while maping inheritance chain and tables, and the different solutions: one table for each subclass, one big table with NULLable fields and a type field, etc.....

 

 

Cheers,

Fabrizio

On 1 Sep 2010, at 14:18, Mariano Martinez Peck wrote:



On Tue, Aug 31, 2010 at 7:36 AM, Tudor Girba <[hidden email]> wrote:
It is useful when you want to understand a database and possibly it's relationship with code.

For example, an SQL query in the string of some Java code that refers to a certain table creates a logical dependency. If we can relate the two worlds, we can build larger analyses.

Does it make better sense now?


Yes. I think that yes :)

I was thinking more from a database driver point of view, not from visualization. Sorry, I forgot this was moose hahhaha

 
Doru



On 31 Aug 2010, at 07:16, Mariano Martinez Peck wrote:

Sorry for my completely ignorance, but what can be the use of parsing SQL?

Suppose from the point of view of a database driver that receives queries, or from a ORM point of view....does it make sense for something?

Thanks

Mariano

On Tue, Aug 31, 2010 at 12:59 AM, Tudor Girba <[hidden email]> wrote:
That is cool news. I will take a look in the following days.

Cheers,
Doru



On 30 Aug 2010, at 16:00, Fabrizio Perin wrote:

Hi all,
i did implement an SQL parser using Petit Parser. I toke the grammar specification from SQLite http://www.sqlite.org/lang.html . The grammar implemented is not complete, for now i did implement "just" the create table statement, it means that you should be able to parse at least a script for create the database.

The code is in squeaksource http://www.squeaksource.com/@09zbthA-fDDfyUNQ/_OIex3aA .

To download it you can evaluate this:

Gofer new
      squeaksource: 'PetitSQLParser';
      package: 'ConfigurationOfPetitSQLParser';
      load.
(Smalltalk at: #ConfigurationOfPetitSQLParser) perform: #loadDefault
in the repository there are several packages: the core contains the parser for the grammar.

In the package parser there is a parser that instantiate some draft objects representing relational elements.

In the next future i will start to implement also other statements.

If you start to use it and you have some problem please let me know.

Cheers,

Fabrizio

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"No matter how many recipes we know, we still value a chef."






_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"What is more important: To be happy, or to make happy?"


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev





--
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Petit SQL Parser

Mariano Martinez Peck


On Wed, May 11, 2011 at 4:06 PM, Fabrizio Perin <[hidden email]> wrote:
Hi Mariano,
well i did improve the parser itself adding also the alter table statement and the select statement. I did also modify the architecture: now the parser generate AST nodes instead the old "draft objects" abstraction. Anyway, as far as i remember, no one attempt to implement any visualization on that. Do you have something in your mind?


Maybe. We don't know yet. We will analyze if having a (or part of) SQL parser will help us in something or not.
This is related to this: http://forum.world.st/Call-for-ideas-for-DBXTalk-UI-td3513189.html

So...I will have in mind your answer.

Thanks

Mariano

 
Cheers,
Fabrizio

On 11 May 2011, at 01:01, Mariano Martinez Peck wrote:

Hi Fabrizio. Any progress on this front ?
did someone do any kind of visualization once the parser was done?

thanks

mariano

On Wed, Sep 1, 2010 at 3:46 PM, Mariano Martinez Peck <[hidden email]> wrote:


On Wed, Sep 1, 2010 at 3:39 PM, Fabrizio Perin <[hidden email]> wrote:
Hi Marian,
here there is an example:
<Example.png>

the one on the top is a class instead the one on the bottom is the database table that the class access.

This is a small example about what you can do by having information about the code and the database in the same model.

Thanks Fabrizio. I got it.

I think it would be cool to visualize the problem while maping inheritance chain and tables, and the different solutions: one table for each subclass, one big table with NULLable fields and a type field, etc.....

 

 

Cheers,

Fabrizio

On 1 Sep 2010, at 14:18, Mariano Martinez Peck wrote:



On Tue, Aug 31, 2010 at 7:36 AM, Tudor Girba <[hidden email]> wrote:
It is useful when you want to understand a database and possibly it's relationship with code.

For example, an SQL query in the string of some Java code that refers to a certain table creates a logical dependency. If we can relate the two worlds, we can build larger analyses.

Does it make better sense now?


Yes. I think that yes :)

I was thinking more from a database driver point of view, not from visualization. Sorry, I forgot this was moose hahhaha

 
Doru



On 31 Aug 2010, at 07:16, Mariano Martinez Peck wrote:

Sorry for my completely ignorance, but what can be the use of parsing SQL?

Suppose from the point of view of a database driver that receives queries, or from a ORM point of view....does it make sense for something?

Thanks

Mariano

On Tue, Aug 31, 2010 at 12:59 AM, Tudor Girba <[hidden email]> wrote:
That is cool news. I will take a look in the following days.

Cheers,
Doru



On 30 Aug 2010, at 16:00, Fabrizio Perin wrote:

Hi all,
i did implement an SQL parser using Petit Parser. I toke the grammar specification from SQLite http://www.sqlite.org/lang.html . The grammar implemented is not complete, for now i did implement "just" the create table statement, it means that you should be able to parse at least a script for create the database.

The code is in squeaksource http://www.squeaksource.com/@09zbthA-fDDfyUNQ/_OIex3aA .

To download it you can evaluate this:

Gofer new
      squeaksource: 'PetitSQLParser';
      package: 'ConfigurationOfPetitSQLParser';
      load.
(Smalltalk at: #ConfigurationOfPetitSQLParser) perform: #loadDefault
in the repository there are several packages: the core contains the parser for the grammar.

In the package parser there is a parser that instantiate some draft objects representing relational elements.

In the next future i will start to implement also other statements.

If you start to use it and you have some problem please let me know.

Cheers,

Fabrizio

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"No matter how many recipes we know, we still value a chef."






_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"What is more important: To be happy, or to make happy?"


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev





--
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--
Mariano
http://marianopeck.wordpress.com


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev