[sqlite] Easy way to change a column

2013-10-08 Thread Bao Niu
For SQLite is there an easy way to find out ALL other tables, queries and
triggers that will be affected when performing a change to a particular
column under the cursor? That would make refactoring so much easier.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] How to use my own python function in a SQLite WHERE clause?

2013-10-02 Thread Bao Niu
I coded a module that has a ChineseDate class, which automatically parse
Chinese dates characters into a python-dateutil object(which actually is a
datetime.datetime object as well).
I used detect_types=sqlite3.PARSE_DECLTYPES to tell the connection object
to store this ChineseDate type directly into one column in my schema. When
inserted into that column, the python ChineseDate object will be
automatically adapted into a complex string, containing the first occuring
date and the interval, etc. Now I want to select all the records with their
MyDate column later than a certain 兔年八月十五, so I built this query:
SELECT * FROM myTable WHERE MyDate > MyModule.ChineseDate("兔年八月十五")
This comparison is legal in the pure Python context because both sides are
a ChineseDate instance. But for some reason I got an
sqlite3.operationalError from running it.
Am I in the wrong path to achieve my goal?
Or more generally, *is this kind of in-place comparison of two native
python objects supported in sqlite3 WHERE clause*?
Or it is not supported at all. WHERE A >= B, A and B must be BOTH dates or
integers or strings ONLY and no other custom types?
Many thanks.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] best practice on sqlite database schema refactoring

2013-09-24 Thread Bao Niu
>From time to time, with a database already loaded with hundreds records, I
need to change a column name, or move a field from one table to another
table(sometimes even another database). I use python to code with my
database. With python if you want to refactor your code there is a lot of
tools to do it automatically, which help change/move function names while
preserving dependencies for you.
Is there an automatic tool for sqlite refactoring? Is doing it manually the
only option? What is the best practice?
Many thanks.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A graphical tool to handle sqlite schema change(more than ALTER TABLE)

2013-09-18 Thread Bao Niu
After a thorough trial I've finally got this firefox add-on to work
properly. And it's great! It basically provides everything that I needed,
except for one: changing foreign key constraints from the gui. Is it
possible to do it from sqlite manager add-on?

And more generally, when a database is already in production and loaded
with records, is it possible to add/remove a foreign key constraint on it?
Thanks.


On Wed, Sep 18, 2013 at 2:26 PM, niubao  wrote:

> I'm sorry I don't quite understand your last reply, would you please
> explain a bit more? Thanks.
>
>
> On Wed, Sep 18, 2013 at 2:01 PM, Jason H [via SQLite] <
> ml-node+s1065341n7135...@n5.nabble.com> wrote:
>
> > It kinda is whe. All you nees is a select into
> >
> > Sent from Yahoo! Mail on Android
> >
> > ___
> > sqlite-users mailing list
> > [hidden email] 
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> >
> > --
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://sqlite.1065341.n5.nabble.com/A-graphical-tool-to-handle-sqlite-schema-change-more-than-ALTER-TABLE-tp71338p71353.html
> >  To unsubscribe from A graphical tool to handle sqlite schema change(more
> > than ALTER TABLE), click here<
> http://sqlite.1065341.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code=71338=bml1YmFvNTZAZ21haWwuY29tfDcxMzM4fDE1NzM1NTM0NjA=
> >
> > .
> > NAML<
> http://sqlite.1065341.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
>
> --
> View this message in context:
> http://sqlite.1065341.n5.nabble.com/A-graphical-tool-to-handle-sqlite-schema-change-more-than-ALTER-TABLE-tp71338p71354.html
> Sent from the SQLite mailing list archive at Nabble.com.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A graphical tool to handle sqlite schema change(more than ALTER TABLE)

2013-09-18 Thread Bao Niu
Linux is the only operating system.
On Sep 18, 2013 5:03 AM, "Simon Slavin"  wrote:

>
> On 18 Sep 2013, at 1:49am, niubao  wrote:
>
> > Is there a tool that allows you to graphically change sqlite schema as
> simple
> > as editing a spreadsheet?
>
> What Operating System ?
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] a tool that allows you to graphically change sqlite schema

2013-09-17 Thread Bao Niu
Is there a tool that allows you to graphically change sqlite schema as
simple as editing a spreadsheet? For example if I wanted to change a column
name from "my_driving_hours" to "driving_time", instead of writing a line
of code, I can just click on that column and type in the new name, letting
the tool automatically create a new database with the new schema and
migrate the old data into the new one. I found it very useful.

I am not sure if there exists such a tool after a long google search. Could
any pros give some thoughts? Many thanks.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users