Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add SQLite objects

  • Loading branch information...
commit c5c1340dbad9188e984ebfb4ddd57e2550af27a7 1 parent 5bb3c04
@OchenZloy authored
View
2  indexer/indexer.compiled
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<CONFIG>
<Compiler Value="/usr/bin/fpc" Date="1274185777"/>
- <Params Value=" -MObjFPC -Scgi -CX -O1 -gl -XX -WG -vewnhi -l -Fi/home/user/work/fb2lib/indexer/ -Fu/usr/lib/lazarus/lcl/units/i386-linux/ -Fu/usr/lib/lazarus/lcl/units/i386-linux/gtk2/ -Fu/usr/lib/lazarus/packager/units/i386-linux/ -Fu/home/user/work/fb2lib/indexer/ -Fu. -FE/home/user/work/fb2lib/indexer/ -oindexer -dLCL -dLCLgtk2 indexer.lpr"/>
+ <Params Value=" -MObjFPC -Scgi -CX -O1 -gl -XX -WG -vewnhi -l -Fi/home/user/work/fb2lib/indexer/ -Fu/home/user/.lazarus/lib/SQLDBLaz/i386-linux/ -Fu/usr/lib/lazarus/components/synedit/units/i386-linux/ -Fu/usr/lib/lazarus/ideintf/units/i386-linux/ -Fu/usr/lib/lazarus/lcl/units/i386-linux/ -Fu/usr/lib/lazarus/lcl/units/i386-linux/gtk2/ -Fu/usr/lib/lazarus/packager/units/i386-linux/ -Fu/home/user/work/fb2lib/indexer/ -Fu. -FE/home/user/work/fb2lib/indexer/ -oindexer -dLCL -dLCLgtk2 indexer.lpr"/>
</CONFIG>
View
98 indexer/indexer.lpi
@@ -8,7 +8,7 @@
<Title Value="FB2 Indexer"/>
<Icon Value="0"/>
<UseXPManifest Value="True"/>
- <ActiveEditorIndexAtStart Value="1"/>
+ <ActiveEditorIndexAtStart Value="0"/>
</General>
<i18n>
<EnableI18N Value="True"/>
@@ -29,20 +29,24 @@
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
- <RequiredPackages Count="1">
+ <RequiredPackages Count="2">
<Item1>
- <PackageName Value="LCL"/>
+ <PackageName Value="SQLDBLaz"/>
+ <MinVersion Major="1" Release="1" Valid="True"/>
</Item1>
+ <Item2>
+ <PackageName Value="LCL"/>
+ </Item2>
</RequiredPackages>
<Units Count="6">
<Unit0>
<Filename Value="indexer.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="indexer"/>
- <CursorPos X="70" Y="10"/>
+ <CursorPos X="80" Y="10"/>
<TopLine Value="1"/>
<EditorIndex Value="1"/>
- <UsageCount Value="20"/>
+ <UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
@@ -51,10 +55,10 @@
<ComponentName Value="Form1"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/>
- <CursorPos X="3" Y="41"/>
- <TopLine Value="30"/>
+ <CursorPos X="3" Y="59"/>
+ <TopLine Value="48"/>
<EditorIndex Value="0"/>
- <UsageCount Value="20"/>
+ <UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
@@ -86,95 +90,127 @@
<UsageCount Value="10"/>
</Unit5>
</Units>
- <JumpHistory Count="22" HistoryIndex="21">
+ <JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="unit1.pas"/>
- <Caret Line="18" Column="37" TopLine="1"/>
+ <Caret Line="17" Column="70" TopLine="4"/>
</Position1>
<Position2>
<Filename Value="unit1.pas"/>
- <Caret Line="23" Column="37" TopLine="3"/>
+ <Caret Line="1" Column="1" TopLine="1"/>
</Position2>
<Position3>
<Filename Value="unit1.pas"/>
- <Caret Line="17" Column="70" TopLine="4"/>
+ <Caret Line="9" Column="29" TopLine="1"/>
</Position3>
<Position4>
<Filename Value="unit1.pas"/>
- <Caret Line="1" Column="1" TopLine="1"/>
+ <Caret Line="24" Column="20" TopLine="20"/>
</Position4>
<Position5>
<Filename Value="unit1.pas"/>
- <Caret Line="9" Column="29" TopLine="1"/>
+ <Caret Line="25" Column="20" TopLine="20"/>
</Position5>
<Position6>
<Filename Value="unit1.pas"/>
- <Caret Line="24" Column="20" TopLine="20"/>
+ <Caret Line="27" Column="20" TopLine="20"/>
</Position6>
<Position7>
<Filename Value="unit1.pas"/>
- <Caret Line="25" Column="20" TopLine="20"/>
+ <Caret Line="35" Column="1" TopLine="21"/>
</Position7>
<Position8>
<Filename Value="unit1.pas"/>
- <Caret Line="27" Column="20" TopLine="20"/>
+ <Caret Line="30" Column="43" TopLine="19"/>
</Position8>
<Position9>
<Filename Value="unit1.pas"/>
- <Caret Line="35" Column="1" TopLine="21"/>
+ <Caret Line="42" Column="81" TopLine="27"/>
</Position9>
<Position10>
<Filename Value="unit1.pas"/>
- <Caret Line="30" Column="43" TopLine="19"/>
+ <Caret Line="41" Column="16" TopLine="30"/>
</Position10>
<Position11>
<Filename Value="unit1.pas"/>
- <Caret Line="42" Column="81" TopLine="27"/>
+ <Caret Line="42" Column="21" TopLine="30"/>
</Position11>
<Position12>
<Filename Value="unit1.pas"/>
- <Caret Line="41" Column="16" TopLine="30"/>
+ <Caret Line="40" Column="6" TopLine="29"/>
</Position12>
<Position13>
<Filename Value="unit1.pas"/>
- <Caret Line="42" Column="21" TopLine="30"/>
+ <Caret Line="39" Column="6" TopLine="30"/>
</Position13>
<Position14>
<Filename Value="unit1.pas"/>
- <Caret Line="40" Column="6" TopLine="29"/>
+ <Caret Line="40" Column="1" TopLine="30"/>
</Position14>
<Position15>
<Filename Value="unit1.pas"/>
- <Caret Line="39" Column="6" TopLine="30"/>
+ <Caret Line="44" Column="1" TopLine="26"/>
</Position15>
<Position16>
<Filename Value="unit1.pas"/>
- <Caret Line="40" Column="1" TopLine="30"/>
+ <Caret Line="42" Column="6" TopLine="33"/>
</Position16>
<Position17>
<Filename Value="unit1.pas"/>
- <Caret Line="44" Column="1" TopLine="26"/>
+ <Caret Line="52" Column="1" TopLine="39"/>
</Position17>
<Position18>
<Filename Value="unit1.pas"/>
- <Caret Line="42" Column="6" TopLine="33"/>
+ <Caret Line="18" Column="28" TopLine="9"/>
</Position18>
<Position19>
<Filename Value="unit1.pas"/>
- <Caret Line="52" Column="1" TopLine="39"/>
+ <Caret Line="18" Column="28" TopLine="9"/>
</Position19>
<Position20>
<Filename Value="unit1.pas"/>
- <Caret Line="18" Column="28" TopLine="9"/>
+ <Caret Line="27" Column="38" TopLine="9"/>
</Position20>
<Position21>
<Filename Value="unit1.pas"/>
- <Caret Line="18" Column="28" TopLine="9"/>
+ <Caret Line="41" Column="3" TopLine="30"/>
</Position21>
<Position22>
<Filename Value="unit1.pas"/>
- <Caret Line="27" Column="38" TopLine="9"/>
+ <Caret Line="22" Column="43" TopLine="9"/>
</Position22>
+ <Position23>
+ <Filename Value="unit1.pas"/>
+ <Caret Line="23" Column="43" TopLine="9"/>
+ </Position23>
+ <Position24>
+ <Filename Value="unit1.pas"/>
+ <Caret Line="24" Column="43" TopLine="9"/>
+ </Position24>
+ <Position25>
+ <Filename Value="unit1.pas"/>
+ <Caret Line="25" Column="43" TopLine="9"/>
+ </Position25>
+ <Position26>
+ <Filename Value="unit1.pas"/>
+ <Caret Line="50" Column="28" TopLine="44"/>
+ </Position26>
+ <Position27>
+ <Filename Value="unit1.pas"/>
+ <Caret Line="8" Column="46" TopLine="6"/>
+ </Position27>
+ <Position28>
+ <Filename Value="unit1.pas"/>
+ <Caret Line="57" Column="23" TopLine="46"/>
+ </Position28>
+ <Position29>
+ <Filename Value="unit1.pas"/>
+ <Caret Line="58" Column="23" TopLine="46"/>
+ </Position29>
+ <Position30>
+ <Filename Value="unit1.pas"/>
+ <Caret Line="59" Column="23" TopLine="46"/>
+ </Position30>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
View
2  indexer/indexer.lpr
@@ -7,7 +7,7 @@
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
- Forms, Unit1, LResources,
+ Forms, Unit1, LResources, SQLDBLaz,
{ you can add units after this }
clocale;
View
8 indexer/locale/indexer.po
@@ -1,6 +1,10 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
+#: TFORM1.BUTTON1.CAPTION
+msgid "Go!"
+msgstr ""
+
#: TFORM1.CAPTION
msgid "Indexer"
msgstr ""
@@ -13,3 +17,7 @@ msgstr ""
msgid "Temp directory"
msgstr ""
+#: TFORM1.LABEL3.CAPTION
+msgid "Database file"
+msgstr ""
+
View
95 indexer/unit1.lfm
@@ -1,14 +1,15 @@
object Form1: TForm1
Left = 290
- Height = 300
+ Height = 330
Top = 200
Width = 400
+ ActiveControl = EditBookDir
Caption = 'Indexer'
- ClientHeight = 300
+ ClientHeight = 330
ClientWidth = 400
OnCreate = FormCreate
Position = poScreenCenter
- SessionProperties = 'EditBookDir.Directory;EditTempDir.Directory'
+ SessionProperties = 'EditBookDir.Directory;EditTempDir.Directory;EditDBFile.FileName'
LCLVersion = '0.9.28.2'
object Label1: TLabel
Left = 24
@@ -26,12 +27,20 @@ object Form1: TForm1
Caption = 'Temp directory'
ParentColor = False
end
+ object Label3: TLabel
+ Left = 24
+ Height = 18
+ Top = 128
+ Width = 87
+ Caption = 'Database file'
+ ParentColor = False
+ end
object EditBookDir: TDirectoryEdit
Left = 24
Height = 27
Top = 35
Width = 336
- ShowHidden = False
+ ShowHidden = True
ButtonWidth = 23
NumGlyphs = 0
TabOrder = 0
@@ -40,9 +49,9 @@ object Form1: TForm1
object EditTempDir: TDirectoryEdit
Left = 24
Height = 27
- Top = 89
+ Top = 88
Width = 336
- ShowHidden = False
+ ShowHidden = True
ButtonWidth = 23
NumGlyphs = 0
TabOrder = 1
@@ -50,15 +59,83 @@ object Form1: TForm1
object MemoLog: TMemo
Left = 0
Height = 108
- Top = 192
+ Top = 222
Width = 400
Align = alBottom
TabOrder = 2
end
+ object EditDBFile: TFileNameEdit
+ Left = 24
+ Height = 27
+ Top = 144
+ Width = 336
+ DialogOptions = [ofCreatePrompt]
+ FilterIndex = 0
+ HideDirectories = False
+ ButtonWidth = 23
+ NumGlyphs = 0
+ TabOrder = 3
+ end
+ object Button1: TButton
+ Left = 24
+ Height = 25
+ Top = 184
+ Width = 75
+ Caption = 'Go!'
+ OnClick = Button1Click
+ TabOrder = 4
+ end
object PropStorage: TIniPropStorage
StoredValues = <>
IniSection = 'Form1'
- left = 24
- top = 136
+ left = 32
+ top = 232
+ end
+ object SQ3Conn: TSQLite3Connection
+ Connected = False
+ LoginPrompt = False
+ KeepConnection = False
+ Transaction = SQLTrans
+ Options = []
+ left = 32
+ top = 288
+ end
+ object SQLTrans: TSQLTransaction
+ Active = False
+ Action = caNone
+ Database = SQ3Conn
+ left = 96
+ top = 288
+ end
+ object SQLQuery: TSQLQuery
+ IndexName = 'DEFAULT_ORDER'
+ Database = SQ3Conn
+ Transaction = SQLTrans
+ ReadOnly = False
+ Params = <>
+ left = 176
+ top = 288
+ end
+ object SQLScript: TSQLScript
+ DataBase = SQ3Conn
+ Transaction = SQLTrans
+ Directives.Strings = (
+ 'SET TERM'
+ 'COMMIT'
+ '#IFDEF'
+ '#IFNDEF'
+ '#ELSE'
+ '#ENDIF'
+ '#DEFINE'
+ '#UNDEF'
+ '#UNDEFINE'
+ )
+ Terminator = ';'
+ CommentsinSQL = True
+ UseSetTerm = True
+ UseCommit = True
+ UseDefines = True
+ left = 248
+ top = 288
end
end
View
52 indexer/unit1.lrs
@@ -1,20 +1,36 @@
-{ Это - файл ресурсов, автоматически созданный lazarus }
-
LazarusResources.Add('TForm1','FORMDATA',[
- 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'"'#1#6'Height'#3','#1#3'Top'#3#200#0#5'Wi'
- +'dth'#3#144#1#7'Caption'#6#7'Indexer'#12'ClientHeight'#3','#1#11'ClientWidth'
- +#3#144#1#8'OnCreate'#7#10'FormCreate'#8'Position'#7#14'poScreenCenter'#17'Se'
- +'ssionProperties'#6'+EditBookDir.Directory;EditTempDir.Directory'#10'LCLVers'
- +'ion'#6#8'0.9.28.2'#0#6'TLabel'#6'Label1'#4'Left'#2#24#6'Height'#2#18#3'Top'
- +#2#18#5'Width'#2'b'#7'Caption'#6#14'Book directory'#11'ParentColor'#8#0#0#6
- +'TLabel'#6'Label2'#4'Left'#2#24#6'Height'#2#18#3'Top'#2'H'#5'Width'#2'd'#7'C'
- +'aption'#6#14'Temp directory'#11'ParentColor'#8#0#0#14'TDirectoryEdit'#11'Ed'
- +'itBookDir'#4'Left'#2#24#6'Height'#2#27#3'Top'#2'#'#5'Width'#3'P'#1#10'ShowH'
- +'idden'#8#11'ButtonWidth'#2#23#9'NumGlyphs'#2#0#8'TabOrder'#2#0#8'OnChange'#7
- +#17'EditBookDirChange'#0#0#14'TDirectoryEdit'#11'EditTempDir'#4'Left'#2#24#6
- +'Height'#2#27#3'Top'#2'Y'#5'Width'#3'P'#1#10'ShowHidden'#8#11'ButtonWidth'#2
- +#23#9'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#5'TMemo'#7'MemoLog'#4'Left'#2#0#6'H'
- +'eight'#2'l'#3'Top'#3#192#0#5'Width'#3#144#1#5'Align'#7#8'alBottom'#8'TabOrd'
- +'er'#2#2#0#0#15'TIniPropStorage'#11'PropStorage'#12'StoredValues'#14#0#10'In'
- +'iSection'#6#5'Form1'#4'left'#2#24#3'top'#3#136#0#0#0#0
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'"'#1#6'Height'#3'J'#1#3'Top'#3#200#0#5'Wi'
+ +'dth'#3#144#1#13'ActiveControl'#7#11'EditBookDir'#7'Caption'#6#7'Indexer'#12
+ +'ClientHeight'#3'J'#1#11'ClientWidth'#3#144#1#8'OnCreate'#7#10'FormCreate'#8
+ +'Position'#7#14'poScreenCenter'#17'SessionProperties'#6'?EditBookDir.Directo'
+ +'ry;EditTempDir.Directory;EditDBFile.FileName'#10'LCLVersion'#6#8'0.9.28.2'#0
+ +#6'TLabel'#6'Label1'#4'Left'#2#24#6'Height'#2#18#3'Top'#2#18#5'Width'#2'b'#7
+ +'Caption'#6#14'Book directory'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'L'
+ +'eft'#2#24#6'Height'#2#18#3'Top'#2'H'#5'Width'#2'd'#7'Caption'#6#14'Temp dir'
+ +'ectory'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left'#2#24#6'Height'#2
+ +#18#3'Top'#3#128#0#5'Width'#2'W'#7'Caption'#6#13'Database file'#11'ParentCol'
+ +'or'#8#0#0#14'TDirectoryEdit'#11'EditBookDir'#4'Left'#2#24#6'Height'#2#27#3
+ +'Top'#2'#'#5'Width'#3'P'#1#10'ShowHidden'#9#11'ButtonWidth'#2#23#9'NumGlyphs'
+ +#2#0#8'TabOrder'#2#0#8'OnChange'#7#17'EditBookDirChange'#0#0#14'TDirectoryEd'
+ +'it'#11'EditTempDir'#4'Left'#2#24#6'Height'#2#27#3'Top'#2'X'#5'Width'#3'P'#1
+ +#10'ShowHidden'#9#11'ButtonWidth'#2#23#9'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#5
+ +'TMemo'#7'MemoLog'#4'Left'#2#0#6'Height'#2'l'#3'Top'#3#222#0#5'Width'#3#144#1
+ +#5'Align'#7#8'alBottom'#8'TabOrder'#2#2#0#0#13'TFileNameEdit'#10'EditDBFile'
+ +#4'Left'#2#24#6'Height'#2#27#3'Top'#3#144#0#5'Width'#3'P'#1#13'DialogOptions'
+ +#11#14'ofCreatePrompt'#0#11'FilterIndex'#2#0#15'HideDirectories'#8#11'Button'
+ +'Width'#2#23#9'NumGlyphs'#2#0#8'TabOrder'#2#3#0#0#7'TButton'#7'Button1'#4'Le'
+ +'ft'#2#24#6'Height'#2#25#3'Top'#3#184#0#5'Width'#2'K'#7'Caption'#6#3'Go!'#7
+ +'OnClick'#7#12'Button1Click'#8'TabOrder'#2#4#0#0#15'TIniPropStorage'#11'Prop'
+ +'Storage'#12'StoredValues'#14#0#10'IniSection'#6#5'Form1'#4'left'#2' '#3'top'
+ +#3#232#0#0#0#18'TSQLite3Connection'#7'SQ3Conn'#9'Connected'#8#11'LoginPrompt'
+ +#8#14'KeepConnection'#8#11'Transaction'#7#8'SQLTrans'#7'Options'#11#0#4'left'
+ +#2' '#3'top'#3' '#1#0#0#15'TSQLTransaction'#8'SQLTrans'#6'Active'#8#6'Action'
+ +#7#6'caNone'#8'Database'#7#7'SQ3Conn'#4'left'#2'`'#3'top'#3' '#1#0#0#9'TSQLQ'
+ +'uery'#8'SQLQuery'#9'IndexName'#6#13'DEFAULT_ORDER'#8'Database'#7#7'SQ3Conn'
+ +#11'Transaction'#7#8'SQLTrans'#8'ReadOnly'#8#6'Params'#14#0#4'left'#3#176#0#3
+ +'top'#3' '#1#0#0#10'TSQLScript'#9'SQLScript'#8'DataBase'#7#7'SQ3Conn'#11'Tra'
+ +'nsaction'#7#8'SQLTrans'#18'Directives.Strings'#1#6#8'SET TERM'#6#6'COMMIT'#6
+ +#6'#IFDEF'#6#7'#IFNDEF'#6#5'#ELSE'#6#6'#ENDIF'#6#7'#DEFINE'#6#6'#UNDEF'#6#9
+ +'#UNDEFINE'#0#10'Terminator'#6#1';'#13'CommentsinSQL'#9#10'UseSetTerm'#9#9'U'
+ +'seCommit'#9#10'UseDefines'#9#4'left'#3#248#0#3'top'#3' '#1#0#0#0
]);
View
2  indexer/unit1.lrt
@@ -1,3 +1,5 @@
TFORM1.CAPTION=Indexer
TFORM1.LABEL1.CAPTION=Book directory
TFORM1.LABEL2.CAPTION=Temp directory
+TFORM1.LABEL3.CAPTION=Database file
+TFORM1.BUTTON1.CAPTION=Go!
View
19 indexer/unit1.pas
@@ -5,20 +5,28 @@
interface
uses
- Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
- EditBtn, StdCtrls, DefaultTranslator, IniPropStorage;
+ Classes, SysUtils, sqlite3conn, sqldb, db, FileUtil, LResources, Forms, Controls,
+ Graphics, Dialogs, EditBtn, StdCtrls, DefaultTranslator, IniPropStorage;
type
{ TForm1 }
TForm1 = class(TForm)
+ Button1: TButton;
EditBookDir: TDirectoryEdit;
EditTempDir: TDirectoryEdit;
+ EditDBFile: TFileNameEdit;
+ Label3: TLabel;
PropStorage: TIniPropStorage;
Label1: TLabel;
Label2: TLabel;
MemoLog: TMemo;
+ SQ3Conn: TSQLite3Connection;
+ SQLQuery: TSQLQuery;
+ SQLScript: TSQLScript;
+ SQLTrans: TSQLTransaction;
+ procedure Button1Click(Sender: TObject);
procedure EditBookDirChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
@@ -46,6 +54,13 @@ procedure TForm1.EditBookDirChange(Sender: TObject);
if (EditTempDir.Directory='') then EditTempDir.Directory := EditBookDir.Directory+'/tmp';
end;
+procedure TForm1.Button1Click(Sender: TObject);
+begin
+// SQLiteLibraryName:='./libsqlite3.so';
+ SQ3Conn.DatabaseName:=EditDBFile.FileName;
+ SQ3Conn.Connected:=True;
+end;
+
initialization
{$I unit1.lrs}
Please sign in to comment.
Something went wrong with that request. Please try again.