Code Monkey home page Code Monkey logo

Comments (4)

kiddinn avatar kiddinn commented on June 12, 2024

ok, I was able to reproduce this, looking at what the bug is and then I'll submit a fix

from l2tscaffolder.

kiddinn avatar kiddinn commented on June 12, 2024

OK, debugging this shows:

SyntaxError('invalid syntax', ('<unknown>', 30, 10, '      self.* = None\n'))

So line 30 in the sqlite_plugin.jinja2....

{% for attr in query_columns[query_name]|sort(false) %}self.{{ attr }} = None

So looking at the query columns here... I get:

{'Messages': ['*']}

If you would do something different than select * then this will work.... since now the generator tries to add the attribute "self.*" which is not valid.

I will add a check to see whether a select * is selected, and advise against it....

You should be able to create the plugin if you change from "SELECT *" to "SELECT column_a, column_b, ...."

from l2tscaffolder.

kiddinn avatar kiddinn commented on June 12, 2024

Now when you try to run the generate this way you get:

Callback function name [#1]: Messages
SQL Statement [#1]: SELECT * FROM messages 
More entries? [Y/n]: n
Unable to configure, with error: UnableToConfigure('Unable to generate parser while using * to select columns. Please adjust your SELECT statements to include explicit column names.',)
Want to try again? [Y/n]:  

That is you'll need to redo the SQL statement.

And if you redo the statement:

Callback function name [#1]: Messages
SQL Statement [#1]: SELECT Message,Timestamp,Foobar FROM messages
More entries? [Y/n]: n

IT will be accepted and the parser will be generated...

from l2tscaffolder.

infosecjosh avatar infosecjosh commented on June 12, 2024

Thanks

from l2tscaffolder.

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.