0.3.3 • Published 5 months ago

vilas v0.3.3

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

About my project

  • author: ViceMusic5
  • email: xarnudvilas@gmail.com
  • version:0.3.3

just a simple project developed and maintained by a undergraduate

ChangeLog:

Now we start to use typescript as the fundamental language, and switch ‘commonJS’ to ‘es6’。Maybe you can use this framework in FRONT insteal END

by the way,because the unstable supportion of "es6",this is just a beta version. I will upgrade it as soon.

and amend some bug in code:D

Now you can give a NULl to express you need not any filter .

A bigger Update ! rejoice !

In the version, we introduce two main class "Filter" and "Item" to build a safer and simpler filter condition.

But ,this version is just a beta, I need some try from my friends , just you!

More specifically, if you hava any question about my framework, please give me a feedback or suggestion through gmail : xarnudvilas@gmail.com

0. How to use this orm frame work

  1. In the 0.1.2 version,we define the methods of introducing again:

    //import by destructing from vilas
    import {DBC} from 'vilas'
    
    //create Database connection object
    const Controller=new DBC({
        database:'MySQL',
        url:'127.0.0.1',
        username: 'root',
        password:'123456',
        databaseName: 'deliver_system',
        port:3306    //optional
    })
    
    //operate the database by 
    Controller.Strategy.query([],'comment').then((result)=>{})
    
    //eliminate connection with you resources
    Controller.disConnect()
  1. change the method of disconnection

    Controller.Strategy.disConnect()

    swift

    Controller.disConnect()
  2. how to use new filter object

    in this version ,we fix a key method , now you can liberally establish embedding or embedded filter condition through And and Or function

    dbc.Strategy.query(['uname']
     , value(12).equal_to(value(12))
     , 'comment')
     .then(result => console.log(result))
     .catch(error=>console.log(error))

    this code is equal to

    select uname from comment where 12=12

1. api

  • class and constructors:

    FunctionIntroparametersreturndescription
    DBC(constructor)const DBC=require('vilas')Object of arguments({database , url, username, password, databaseName, port})DBC ObjectDataBase Controller, which has many responsibilities like establish connection, operation in databaseTable , release connection and so on.
    FilterNOTICE: we don't agree use this contructor when you build a web-app!--------------------------------------------------This object stand for the filter condition(WHERE) in your sql selection sentences. (NOTICE: you can only get this object by the comparable function of Item and the "and" "or" function, rather than use contructor)
    ItemNOTICE: we don't agree use this contructor when you build a web-app!-------------------------------------------------The super class of Column and Value (NOTICE: you can only get this object by the specifical function of Item )
    ColumnNOTICE: we don't agree use this contructor when you build a web-app!The name of one of column in a sql
    ValueNOTICE: we don't agree use this contructor when you build a web-app!The value of one of value in a sql
  • function of DBC

    FunctionIntroparameterreturndescription
    disConnectDBC.disConnect()---------close a database connection and release some resource
  • function of Strategy in DBC

    FunctionIntroparameterreturn
    query_out_dateDBC.Strategy.query_out_date()parameter:array, filters:array,tableName:stringpromise
    appendDBC.Strategy.append()columns:array,values:array,table:stringpromise
    remove_out_dateDBC.Strategy.remove_out_date()filters:array,table:stringpromise
    change_out_dateDBC.Strategy.change_out_date()columns:array,values:array,filters:array,table:stringpromise
    getInfoOfColDBC.Strategy.getInfoOfCol()table:stringpromise
    queryDBC.Strategy.queryparameter:array,tableName:string,filter:Filterpromise
    removeDBC.Strategy.removetableName:string,filter:Filterpromise
    changeDBC.Strategy.changecolumns:array,values:array,tableName:string,filter:Filterpromise
  • function of Item

    FunctionIntroparameterreturndescription
    equal_toItem.equal_to()ItemFilter=
    unEqual_toItem.unEqual_to()ItemFilter!=
    move_thanItem.move_than()ItemFilter>
    move_or_equalItem.move_or_equal()ItemFilter>=
    less_thanItem.less_than()ItemFilter<
    less_or_equalItem.less_or_equal()ItemFilter<=
    like_withItem.like_with()ItemFilterLike operation in your sql sentences
  • function of Filter

    FunctionIntroparameterreturndescription
    andFilter.and()FilterFilterestablish a 'and' relation between two Filter
    orFilter.or()FilterFilterestablish a 'or' relation between two Filter
    waiting......
    waiting......
  • some additional function (being used to get Column and Value object )

    FunctionIntroparameterreturndescription
    columnconst {column} = require("vlias"); column()text:stringItemlike a constructor without "new"
    valueconst {value} = require("vlias"); value()text:autoItemlike a constructor without "new"
0.3.3

5 months ago

0.3.2

5 months ago

0.3.1

6 months ago

0.3.0

6 months ago

0.2.1

6 months ago

0.2.0

6 months ago

0.1.4

6 months ago

0.1.3

6 months ago

0.1.2

6 months ago

0.1.1

7 months ago

0.1.0

7 months ago

1.0.0

7 months ago