Share My Creation B4JPrompt - The beginning of a Sqlite Repl

Hi,

Update to Sqlite Repl, 07/31/2017

Implemented RECORDS command. This returns the number of records in the Current Query, or the number of records in the Current Table.

Fixed an incomplete sentence regarding HTMLINPUT in the instructions, and added examples for the RECORDS command.

Worked out a better way to bring back previous commands, with the UP and DOWN arrow keys, at the prompt.




This is a work in progress, so I wasn’t planning to share it for at least another few months.

But in case I get too busy after they announce some new projects at the office later this week, I’m putting it on the forum, now.

Lots & lots to do and fix and clean. But some of the Sqlite commands might be useful to some. Actually, the way it’s going, the project might be better named ‘Sqlite Repl’, rather than ‘B4JPrompt’.


Sample commands can be found in B4JPrompt_Instructions.txt, but some of that document is reproduced here:


Sample commands:
(Note, for database commands, place the sqlite database in your application File.DirApp folder.)



*************************************************************************
To quit, type QUIT:

QUIT
*************************************************************************



*************************************************************************

DIR

(Output:
[bin]
chinook.db
[shell]
[src]
test.txt
)
*************************************************************************


*************************************************************************
List contents of file test.txt, in working folder:

LIST FILE test.txt

(Output:
Random text generated by
http://randomtextgenerator.com/

Situation admitting promotion at or to perceived be. Mr acuteness we as estimable enjoyment up. An held late as felt know. Learn do allow solid to grave. Middleton suspicion age her attention. Chiefly several bed its wishing. Is so moments on chamber pressed to. Doubtful yet way properly answered humanity its desirous. Minuter believe service arrived civilly add all. Acuteness allowance an at eagerness favourite in extensive exquisite ye.

Admiration stimulated cultivated reasonable be projection possession of. Real no near room ye bred sake if some. Is arranging furnished knowledge agreeable so. Fanny as smile up small. It vulgar chatty simple months turned oh at change of. Astonished set expression solicitude way admiration.

Attachment apartments in delightful by motionless it no. And now she burst sir learn total. Hearing hearted shewing own ask. Solicitude uncommonly use her motionless not collecting age. The properly servants required mistaken outlived bed and. Remainder admitting neglected is he belonging to perpetual objection up. Has widen too you decay begin which asked equal any.

Did shy say mention enabled through elderly improve. As at so believe account evening behaved hearted is. House is tiled we aware. It ye greatest removing concerns an overcame appetite. Manner result square father boy behind its his. Their above spoke match ye mr right oh as first. Be my depending to believing perfectly concealed household. Point could to built no hours smile sense.

That know ask case sex ham dear her spot. Weddings followed the all marianne nor whatever settling. Perhaps six prudent several her had offence. Did had way law dinner square tastes. Recommend concealed yet her procuring see consulted depending. Adieus hunted end plenty are his she afraid. Resources agreement contained propriety applauded neglected use yet.

Is he staying arrival address earnest. To preference considered it themselves inquietude collecting estimating. View park for why gay knew face. Next than near to four so hand. Times so do he downs me would. Witty abode party her found quiet law. They door four bed fail now have.

So insisted received is occasion advanced honoured. Among ready to which up. Attacks smiling and may out assured moments man nothing outward. Thrown any behind afford either the set depend one temper. Instrument melancholy in acceptance collecting frequently be if. Zealously now pronounce existence add you instantly say offending. Merry their far had widen was. Concerns no in expenses raillery formerly.

Two assure edward whence the was. Who worthy yet ten boy denote wonder. Weeks views her sight old tears sorry. Additions can suspected its concealed put furnished. Met the why particular devonshire decisively considered partiality. Certain it waiting no entered is. Passed her indeed uneasy shy polite appear denied. Oh less girl no walk. At he spot with five of view.

Certainty determine at of arranging perceived situation or. Or wholly pretty county in oppose. Favour met itself wanted settle put garret twenty. In astonished apartments resolution so an it. Unsatiable on by contrasted to reasonable companions an. On otherwise no admitting to suspicion furniture it.

Tolerably earnestly middleton extremely distrusts she boy now not. Add and offered prepare how cordial two promise. Greatly who affixed suppose but enquire compact prepare all put. Added forth chief trees but rooms think may. Wicket do manner others seemed enable rather in. Excellent own discovery unfeeling sweetness questions the gentleman. Chapter shyness matters mr parlors if mention thought.
)

*************************************************************************



*************************************************************************
To clear the output box, just type CLEAR

CLEAR
*************************************************************************




*************************************************************************
Database commands:


SET DATABASE TO chinook.db

LIST TABLES

(Output:
albums
sqlite_sequence
artists
customers
employees
genres
invoices
invoice_items
media_types
playlists
playlist_track
tracks
sqlite_stat1
)

SET TABLE TO albums

LIST STRUCTURE

(Output:
Structure of table albums in chinook.db:
Field name,Field Type,Not Null,Primary Key
AlbumId, INTEGER, 1, 1
Title, NVARCHAR(160), 1, 0
ArtistId, INTEGER, 1, 0
)


SET FIELDS TO Title,ArtistId

SET LIMIT TO 10

LIST
(Output:
Title| ArtistId
For Those About To Rock We Salute You | 1
Balls to the Wall | 2
Restless and Wild | 2
Let There Be Rock | 1
Big Ones | 3
Jagged Little Pill | 4
Facelift | 5
Warner 25 Anos | 6
Plays Metallica By Four Cellos | 7
Audioslave | 8
)


For further commands, look at B4JPrompt_Instructions.txt, or scan through the code, specifically the ExecuteUDFS module.
 

Attachments

  • B4JPrompt_ScreenPrint.jpg
    B4JPrompt_ScreenPrint.jpg
    91.4 KB · Views: 3,050
  • B4JPrompt.zip
    408.7 KB · Views: 356
Last edited:

B4JExplorer

Active Member
Licensed User
Longtime User
Update to Sqlite Repl, 07/31/2017

Implemented RECORDS command. This returns the number of records in the Current Query, or the number of records in the Current Table.

Fixed an incomplete sentence regarding HTMLINPUT in the instructions, and added examples for the RECORDS command.

Worked out a better way to bring back previous commands, with the UP and DOWN arrow keys, at the prompt.
 
Top