Skip to content

yuenci/sqlParser-SQL2TXT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL2TXT

This project is an implementation of operating txt with SQL, which is equivalent to using TXT files as a database, and can be used in some special cases.

Getting Started

Add sqlParser.jar package to module dependencies of your project.

Running the tests

Under the example folder, there are test cases of Insert, Select, Update, Delete, and you can directly run the main function test.

Demo

Insert

Insert

Select

Select

Update

Update

Delete

Delete

Select functions: max(), min(). count(), avg(), sum()

functuons

Select distinst

sitinst

Order(ASC, DESC)

Order

Features

  • Support using insert, select, update, and delete to CRUD.

  • Insert supports simultaneous insertion of multiple data.

Example: insert into testtable (name, address) values ('innis',' China'), ('kk',' Malaysia')

  • Insert can ignore column name insertion.

Example: insert into testtable values ('innis', 23,' China' ).

  • Support using the Where sentence + logic words to filter the content (likes don't support mixed logic)

Example: delete from testtable where address =' China' or (name =' inners3' and age = 27);

  • Support the comparing of =, <>, >, > =, <, < =
  • Support the select function of count, sum, avg, max, min, and distinct
select max(age) from datetime where address = 'China'
select min(age) from datetime where address = 'China'
select count(age) from datetime where address = 'China'
select avg(age) from datetime where address = 'China'
select sum(age) from datetime where address = 'China'
select distinct(age) from datetime where address = 'China'
  • Support the select function of order by
select * from datetime where address = 'China' order by birthday asc
select * from datetime where address = 'China' order by birthday desc

Restriction

  • Select, Update, Delete must have a Where clause.
  • String content must be wrapped in single quotation marks.

Roadmap

  • Date, DateTime dataType
  • Max,Min,count,avg,sum
  • Order
  • Compare dateTime,date
  • Group
  • Join

Coming Soon!

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

profile image

License

This project is licensed under the MIT License

About

Using SQL statement operation txt file CRUD

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages