GithubHelp home page GithubHelp logo

sqliteorm's Introduction

Field types and Relationships

Fields Supported

"CharField"
"TextField" [Need to complete the tests]
"AutoField"
"IntegerField" [not implemented yet]
"DecimalField" [not implemented yet]
"FloatField" [not implemented yet]
"DateTimeField" [not implemented yet]
"BooleanField" [not implemented yet]
"ImageField" [not implemented yet]
"FileField" [not implemented yet]

Relationship supported

Primary Key

  1. Each Table with Only one PK (primary_key = True)

  2. Supoorts multiple unqiue constrainsts in a table (unique=True)

  3. Does not support composite primary key

  4. Can not use Primary key and unique set to True at the same time.

Foreign Key

  1. Does not support Polymorphic association (multiple FK in a single table)

  2. Supports Recursive Relationship [not implemented yet]

One To One

  1. Supports 1:1

ManyToMany

  1. Supports M:N

Folder Layout

  1. docs/ - contains docs generated by Sphinx
  2. orm/ - changed it to single file orm.py has all the code and example.py shows an example of what has been implemented until now.
  3. tests/ - It has tests for orm.py files.

NOTE: You can read more about implementation in the docs/_build/html/index.html
Also, docs and new implementation might not match if I forgot to re-generate it.

How it's supposed to be used

class User(Model):
	# if you don't specify class name will be used
	_table = "user"
	name = CharField(primary_key=True, max_length=10)
	bio = TextField()
	age = IntegerField()

migration = MigrationManager([User, Blog])
migration.apply()

u = User(name="John", bio="some random text", age=10)
u.save()
u.objects.get(name="john")

sqliteorm's People

Contributors

noobextendsbot avatar

Watchers

 avatar

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.