Code Monkey home page Code Monkey logo

Comments (22)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
I would like to have it too :-)

Original comment by [email protected] on 4 Mar 2012 at 9:05

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024

Original comment by [email protected] on 12 Mar 2012 at 10:13

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
You can follow the progress on this issue on 
http://php-sql-parser.googlecode.com/svn/branches/create-table.
Let me some days to think about a solution.

Original comment by [email protected] on 23 Mar 2012 at 9:50

  • Changed state: Started

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
Can you provide an example of your CREATE statements? If I implement all 
features of the MySQL statement, I will have to do till Xmas. Which feature 
subset would help you?

Original comment by [email protected] on 23 Mar 2012 at 10:15

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
I tried it, and find useful - but I cant see other things, like "ENGINE", 
"CHARSET", "ROW_FORMAT" in case of showing create table, am I doing something 
wrong?

Original comment by [email protected] on 16 Feb 2013 at 12:29

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
Not sure if i am not using the branch correctly but i still get the same result 
as with the main branch that does not support CREATE.

Lets say i have this create statement:

CREATE TABLE "cachetable01" (
  "sp_id" varchar(240) DEFAULT NULL,
  "ro" varchar(240) DEFAULT NULL,
  "balance" varchar(240) DEFAULT NULL,
  "last_cache_timestamp" varchar(25) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

It would be awesome if i can just get the field names and the field attributes 
separated. 

Original comment by [email protected] on 19 Sep 2013 at 1:14

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
I had started the branch during a travel by rail, but the CREATE TABLE support 
isn't finished yet. There were a lot of open problems.

Original comment by [email protected] on 25 Oct 2013 at 7:37

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
The parser supports now 
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name LIKE old_tbl_name;
See r496. The LIKE must not set inset parenthesis.

Actually I can close the issue, we have CREATE TABLE support now .... LOL.

Original comment by [email protected] on 9 Nov 2013 at 2:11

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
It's r502, I forgot to check-in a file.

Original comment by [email protected] on 9 Nov 2013 at 2:19

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
r515 knows all the table options like ENGINE or CHARACTER SET.

Original comment by [email protected] on 11 Nov 2013 at 9:04

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
r525 generates some column-def output for the example above. But there is still 
a lot to do.

Original comment by [email protected] on 15 Nov 2013 at 8:43

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
Yesterday I had time to implement some things. The parser knows now datatypes 
and columns. There are some errors but the test cases for issue 33 should 
output some helpful thing.

Original comment by [email protected] on 27 Nov 2013 at 8:13

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
I want to parse sql statements from sqlite_master.
They have de form:
CREATE TABLE turma(id text NOT NULL ,
nome text NOT NULL ,
nota1 int NOT NULL ,
nota2 int NOT NULL 
)

The current stable release does that?
I am getting the following error:
[06-Dec-2013 11:31:31] PHP Fatal error:  Uncaught exception 
'UnableToCalculatePositionException' with message 'cannot calculate position of 
id text NOT NULL within ' in 
/Applications/MAMP/htdocs/PHP-SQL-Parser/classes/position-calculator.php:188
Stack trace:
#0 
/Applications/MAMP/htdocs/PHP-SQL-Parser/classes/position-calculator.php(204): 
PositionCalculator->lookForBaseExpression('CREATE TABLE tu...', 101, Array, 0, 
Array)
#1 
/Applications/MAMP/htdocs/PHP-SQL-Parser/classes/position-calculator.php(204): 
PositionCalculator->lookForBaseExpression('CREATE TABLE tu...', 101, Array, 
'sub_tree', Array)
#2 
/Applications/MAMP/htdocs/PHP-SQL-Parser/classes/position-calculator.php(204): 
PositionCalculator->lookForBaseExpression('CREATE TABLE tu...', 101, Array, 
'create-def', Array)
#3 
/Applications/MAMP/htdocs/PHP-SQL-Parser/classes/position-calculator.php(204): 
PositionCalculator->lookForBaseExpression('CREATE TABLE tu...', 101, Array, 
'TABLE', Array)
#4 
/Applications/MAMP/htdocs/PHP-SQL-Parser/classes/position-calculator.php(71): 
PositionCalculator->lookFor in 
/Applications/MAMP/htdocs/PHP-SQL-Parser/classes/position-calculator.php on 
line 188

TIA
jcr

Original comment by [email protected] on 6 Dec 2013 at 11:39

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
Hm, the issue has not been fixed. Try to disable the position calculator with 
$parser->parse($sql, false). I have not tested the CREATE statement with the 
position calculator, so there are possible problems.

Original comment by [email protected] on 6 Dec 2013 at 11:53

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
@zzglider

I have to enhance the position calculator with the new ExpressionType 
constants. In your example the type "create-def" is not known within the 
calculator and results in a wrong output. For the CREATE TABLE statement I have 
defined a lot of new types, so after the parser is complete for CREATE TABLE, I 
will come back to the calculator.

Because the parser output still is not finished, it makes no sense to enhance 
the calculator now. Please wait some days or try to implement your own solution 
:-)

Original comment by [email protected] on 6 Dec 2013 at 12:12

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
I have fixed some problems in r623, you can test CREATE TABLE statements in 
your client code. These things are open:

1. union keywords doesn't work
2. partition handling doesn't work
3. CREATE TABLE followed by SELECT doesn't work
4. PositionCalculator doesn't work with CREATE TABLE
5. Creator doesn't know CREATE TABLE statements

All other features should be okay. I would handle point 3 till 5 now, the other 
are a lot of work, they will be done on the next release.

Original comment by [email protected] on 8 Dec 2013 at 1:29

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
Parser should now understand SELECT statements which follow a CREATE TABLE. See 
r631.

Original comment by [email protected] on 10 Dec 2013 at 12:28

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
Parser can calculate the positions for CREATE TABLE statements now. See r725.

Original comment by [email protected] on 11 Dec 2013 at 12:38

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
The current tag 2014-01-08 contains the point 3 till 5 (see comment #16). I'll 
start with partition handling soon.

Original comment by [email protected] on 8 Jan 2014 at 2:28

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
Some PARTITION output is available in r988.

Original comment by [email protected] on 10 Jan 2014 at 2:56

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
There are some problems within the partition-definition, don't use it at the 
moment. Partition-options should be fine.

Original comment by [email protected] on 23 Jan 2014 at 3:07

from php-sql-parser.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
The parser output for partitions and subpartitions have been finished. The 
parser can also calculate the string positions. The Creator can not build the 
clauses at the moment.

From the list above, we still have open the first point, the UNION keyword.

Original comment by [email protected] on 24 Jan 2014 at 1:59

from php-sql-parser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.