Giter Club home page Giter Club logo

kahless's Introduction

kahless

kahless (KAY-less) is an attempt at an ORM for Dictu.

Drivers

  • SQLite
  • MySQL (coming soon...)

Models

Kahless provides a base class model that can be used in user models.

The fields included:

  • id: INTEGER PRIMARY KEY, AUTOINCREMENT
  • created_at: DATETIME
  • updated_at: DATETIME
  • deleted_at: DATETIME

Class Annotations

@Table("TABLE_NAME")

This annotation is required to be applied to any class used as a model.

Field Annotations

None of the field annotations are required.

@Type("type")

Explicitly set the type of the field. Kahless will attempt to determine the type of the field for you if left off.

@Column("column_name")

This annotations is required. It tells Kahless the name of the column associated with the field.

@PrimaryKey

Indidates that the field is to be used as the primary key for the table.

@AutoIncrement

Automatically increments the value for the field. This is used in conjunction to the @PrimaryKey annotation.

Eamples

For a full example, examine the example.du file.

API

Retrieving Records

  • first
  • last
  • take

Deleting Records

  • delete

If the model contains a field called deletedAt, you receive soft delete ability automatically. If the model doesn't contain this field, the record is deleted permanently.

Updating Records

  • update

Raw Queries

  • rawQuery

Contact

Brian Downs @bdowns328

License

Kahless source code is available under the BSD 3 Clause License.

kahless's People

Contributors

briandowns 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.