Code Monkey home page Code Monkey logo

sql-select-ts's Introduction

sql-select-ts

A modern, database-agnostic, composable SELECT query builder with great typescript support.

Install

Install from npm

npm i sql-select-ts

Getting started & Documentation

Check out the examples and docs.

sql-select-ts's People

Contributors

lucasavila00 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

sql-select-ts's Issues

Query.apply

export const xxxxxxxx = (args: yyyyy) =>
    pipe(
        select(
            _f => ({
               ........
            }),
           table
        ).where(f => [
            //
           aaaaaa
        ]),
        groupSortLimit
    );

to remove usage of this pipe

Investigate replacing split-alias-with-dot with nested proxies

// this should work
t.select(f => ({"a.b": f.a.b}).select(f => ({"a.b": f["a.b"]})


// this should be distinguishable
select 1 as `t1.eid`, `t1`.`eid`, `t1.eid` from t1 limit 1

A little experiment should be possible without too much re-design on the type structure

Types are not compiled correctly


node_modules/sql-select-ts/lib/index.d.ts:108:467 - error TS1005: '?' expected.

108 export declare const except: <C extends SelectStatement<any, any>, CS extends SelectStatement<any, any>[]>(content: [C, ...CS]) => Compound<(C extends SelectStatement<infer _Scope extends string, infer Selection extends string> ? Selection : never) | (CS[number] extends infer T ? T extends CS[number] ? T extends SelectStatement<string, string> ? string : never : never : never), C extends SelectStatement<infer _Scope extends string, infer Selection extends string> ? Selection : never>;
                                                                                                                                                                                                                            

Select + alias

select sum(it) as it, it*2 as sum from (...)

select sum(t.it) as it, t.it*2 as sum from (...) as t

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.