Coder Social home page Coder Social logo

tsql's People

Contributors

dependabot[bot] avatar letsmelon avatar

Stargazers

 avatar

Watchers

 avatar

tsql's Issues

Implement "dialects"

Some datatypes are not supported in every database platform.

Eg.:

PostgreSQL has the datatype uuid while MySQL and SQLite don't have the datatype, uuid is there either a text-type or binary(16).

PostgreSQL: docs
MySQL: blog about uuid

Suggested "dialects"

  • PostgreSQL
  • MySQL
  • SQLite

Reduce memory footprint of executable `tsql`

At the current commit c3b5053 the ./src-folder contains 14 clone() method calls.

Things to do:

All clone()'s currently in the project
14 results - 3 files

src/lib.rs:
  25              Ok((c, table)) => {
  26:                 let c = c.to_string().clone();
  27  
  28:                 let name = table.name.clone();
  29                  raw_tables.insert(name, Rc::new(RefCell::new(table)));

src/types.rs:
   46          while let Some((name, table)) = get_first_element(&raw_tables) {
   47:             let name = name.clone();
   48:             let table = table.clone();
   49  

   56                      .iter()
   57:                     .map(|item| item.borrow().name.clone())
   58                      .collect::<Vec<_>>();

   83  
   84:             parsed.insert(parsed_table.name.clone(), parsed_table);
   85          }

   97  
   98:         parsed_table.name = raw.name.clone();
   99  

  104                          .fields
  105:                         .insert(raw_field.name.clone(), Field::parse(raw_field)?);
  106                  }

  122                          let field = Field {
  123:                             name: field_name.clone(),
  124                              datatype: fk_field.datatype,
  125                              foreign_key_reference: Some((
  126:                                 fk_table_name.clone(),
  127:                                 Rc::new(fk_field.clone()),
  128                              )),

  148                  .primary_key
  149:                 .push(primary_key_field.clone());
  150          }

  187                  .iter()
  188:                 .map(|item| item.foreign_key_reference.as_ref().unwrap().1.name.clone())
  189                  .collect::<Vec<_>>()

src/parser/types.rs:
  24                      RawDataType::ForeignKeyTable(table_name) => {
  25:                         table_names.push(table_name.clone())
  26                      }

Add more (basic) types

Add more types to tsql. I think it would be good to have basic datatypes and then maybe extra data types for MySQL, PostgreSQL, ... .

Basic types:

For more see PostgreSQL official docs

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.