Giter VIP home page Giter VIP logo

sqliteframe's Introduction

Avatar

   Welcome to my profile!    

   Typed Description


    Projects

These are the key projects I have created, or am currently creating. You can also see other projects I have worked on by viewing my repositories.

      

      

      




    Skills

Below are my key skills as a Software / Web Developer. These are tools and environments that I often work with the build projects and solve problems.




    Contact Me

If you have a query relating directly to one of my projects, feel free to open an issue for that project. Otherwise, you can contact me on the below platforms.

                         




    Statistics

Below are my GitHub stats. Some may be inaccurate, as contributions to organizations are not counted.

Kieran's GitHub Stats

sqliteframe's People

Contributors

kieran-lock avatar kieran-lock-legacy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sqliteframe's Issues

Strings are saved with quotes

When writing data to string field, the string in the SQLite DB contains not only the string value, but also a pair of double quotes.

It looks like the SQL INSERT or UPDATE statement contains '"MyString"' instead of 'MyString' for the values.

Table creation does not preserve order of fields

When creating a table, the fields are generated in alphabetical order. The order from the class in the python code is not preserved.

Example

This class from the project example

@table(database)
class TableName:
    primary_key_field = String(primary_key=True)  # The primary key parameter is False by default
    second_column = Integer  # If only the default options are required, no brackets are necessary either
    third_column = Boolean(nullable=True)  # The nullable parameter is False by default
    fourth_column = String(default="This is a default value.")  # You can also opt-in to giving columns default values like this

leads to this debug output:

CREATE TABLE IF NOT EXISTS TableName (
	fourth_column TEXT NOT NULL DEFAULT "This is a default value.",
	primary_key_field TEXT PRIMARY KEY NOT NULL,
	second_column INTEGER NOT NULL,
	third_column BOOLEAN
);

fourth_column should be the last item in the CREATE TABLE statement, but it's the first, because the fields have been sorted alphabetically.

TypeError: 'module' object is not callable

Hi

I'm trying to use your library, but on the first with the following code:

from sqliteframe import table, Integer, String, ForeignKey,Database
database = Database('bep.sqlite',output=True,foreign_keys=True)
@table(db)
class Alert:
    id = Integer(primary_key=True)
    creation_date = String(nullable=False)
    last_update = String(nullable=False)
    search_term = String(nullable=False)

def main():
    insert_stmt = Offer.insert_into({
        'ref':'124',
        'tipo':'tipo'
    })
    insert_stmt.execute()

if __name__ == '__main__':
    main()

if fails on Windows in Python 3.10.4 (Anaconda) with the error:

Traceback (most recent call last):
  File "s:\bep_alerter\models.py", line 6, in <module>
    @table(database)
TypeError: 'module' object is not callable

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.