head 1.2; access; symbols perseant-exfatfs-base-20250801:1.2 perseant-exfatfs-base-20240630:1.2 perseant-exfatfs:1.2.0.22 perseant-exfatfs-base:1.2 cjep_sun2x:1.2.0.20 cjep_sun2x-base:1.2 cjep_staticlib_x-base1:1.2 cjep_staticlib_x:1.2.0.18 cjep_staticlib_x-base:1.2 phil-wifi-20200421:1.2 phil-wifi-20200411:1.2 phil-wifi-20200406:1.2 pgoyette-compat-merge-20190127:1.2 pgoyette-compat-20190127:1.2 pgoyette-compat-20190118:1.2 pgoyette-compat-1226:1.2 pgoyette-compat-1126:1.2 pgoyette-compat-1020:1.2 pgoyette-compat-0930:1.2 pgoyette-compat-0906:1.2 pgoyette-compat-0728:1.2 pgoyette-compat-0625:1.2 pgoyette-compat-0521:1.2 pgoyette-compat-0502:1.2 pgoyette-compat-0422:1.2 pgoyette-compat-0415:1.2 pgoyette-compat-0407:1.2 pgoyette-compat-0330:1.2 pgoyette-compat-0322:1.2 pgoyette-compat-0315:1.2 pgoyette-compat:1.2.0.16 pgoyette-compat-base:1.2 perseant-stdc-iso10646:1.2.0.14 perseant-stdc-iso10646-base:1.2 prg-localcount2-base3:1.2 prg-localcount2-base2:1.2 prg-localcount2-base1:1.2 prg-localcount2:1.2.0.12 prg-localcount2-base:1.2 pgoyette-localcount-20170426:1.2 bouyer-socketcan-base1:1.2 pgoyette-localcount-20170320:1.2 bouyer-socketcan:1.2.0.10 bouyer-socketcan-base:1.2 pgoyette-localcount-20170107:1.2 pgoyette-localcount-20161104:1.2 localcount-20160914:1.2 pgoyette-localcount-20160806:1.2 pgoyette-localcount-20160726:1.2 pgoyette-localcount:1.2.0.8 pgoyette-localcount-base:1.2 yamt-pagecache-base9:1.2 yamt-pagecache-tag8:1.2 tls-earlyentropy:1.2.0.4 tls-earlyentropy-base:1.2 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.2 riastradh-drm2-base3:1.2 agc-symver:1.2.0.6 agc-symver-base:1.2 tls-maxphys-base:1.2 yamt-pagecache-base8:1.2 yamt-pagecache-base7:1.2 yamt-pagecache-base6:1.2 yamt-pagecache-base5:1.2 yamt-pagecache-base4:1.2 yamt-pagecache-base3:1.2 yamt-pagecache-base2:1.2 yamt-pagecache:1.2.0.2 yamt-pagecache-base:1.2; locks; strict; comment @# @; 1.2 date 2011.10.15.13.02.24; author mbalmer; state dead; branches; next 1.1; 1.1 date 2011.10.15.10.27.06; author mbalmer; state Exp; branches; next ; desc @@ 1.2 log @Remove, has been moved to share/examples/lua. @ text @require 'sqlite' print('initialize sqlite') sqlite.initialize() print('this is sqlite ' .. sqlite.libversion() .. ' (' .. sqlite.libversion_number() .. ')') print('sourceid ' .. sqlite.sourceid()) db, state = sqlite.open('db.sqlite', sqlite.OPEN_READWRITE + sqlite.OPEN_CREATE) if state ~= sqlite.OK then print('db open failed') else err = db:exec('create table test (name varchar(32))') if err ~= sqlite.OK then print('table creation failed') print('error code ' .. db:errcode() .. ' msg ' .. db:errmsg()) end db:exec("insert into test values('Balmer')") stmt = db:prepare("insert into test values(:name)") print('statement has ' .. stmt:bind_parameter_count() .. ' parameters') print('param 1 name: ' .. stmt:bind_parameter_name(1)) print('param name is at index ' .. stmt:bind_parameter_index('name')) stmt:bind(1, 'Hardmeier') stmt:step() stmt:reset() stmt:bind(1, 'Keller') stmt:step() stmt:finalize() s2 = db:prepare('select name from test') while s2:step() == sqlite.ROW do print('name = ' .. s2:column(1)) end s2:finalize() stmt = db:prepare('drop table testx') stmt:step() stmt:finalize() db:close() end print('shutdown sqlite') sqlite.shutdown() @ 1.1 log @A small test/demo program to show the sqlite Lua module usage. @ text @@