How to Rename a Column in SQLite Database
-
Believe it or not, until September of 2018, renaming a column in SQLite was not an option! Sounds crazy, but there is some underlying data store reasons why this was a challenge. But they did add this feature, but older guides will tell you otherwise. Now it is easy to do with the following style command...
ALTER TABLE mytable RENAME COLUMN old_column_name TO new_column_name;
-
@scottalanmiller Why do people use SQLite again??
-
@jmoore said in How to Rename a Column in SQLite Database:
@scottalanmiller Why do people use SQLite again??
Sometimes it is bundled and installed with the user facing product.
-
@JasGot said in How to Rename a Column in SQLite Database:
@jmoore said in How to Rename a Column in SQLite Database:
@scottalanmiller Why do people use SQLite again??
Sometimes it is bundled and installed with the user facing product.
Lol I get that. I was being pretty facetious:)
-
@jmoore said in How to Rename a Column in SQLite Database:
Lol I get that. I was being pretty facetious:)
That's funny. I just did what bothers me when other people do it! Sorry, I should have actually thought about what I was typing and better considered who I was typing to.
I'll just chalk it up to helping others who may come along and actually wonder how it could become installed!
-
@jmoore said in How to Rename a Column in SQLite Database:
@scottalanmiller Why do people use SQLite again??
I mean it's good for testing and for light usage. I've done a couple projects with it because it was easy.
-
@jmoore said in How to Rename a Column in SQLite Database:
@scottalanmiller Why do people use SQLite again??
Screaming fast, extremely stable, super light weight. In small deployments, it's actually pretty hard to beat. It's actually amazing that it isn't used far more often.
-
@stacksofplates said in How to Rename a Column in SQLite Database:
@jmoore said in How to Rename a Column in SQLite Database:
@scottalanmiller Why do people use SQLite again??
I mean it's good for testing and for light usage. I've done a couple projects with it because it was easy.
Yeah, easy to dev, easy to deploy, really easy for the IT guy on site to deal with. No service to run, nothing complex to deal with, no ports to manage.
Pretty limited in its scope, but for a lot of things, it does the job.
-
There used to be a lot of databases like SQLite. Often called database engines. dBase was probably one of the first.
Later Microsoft Jet engine (aka Microsoft Access) became popular when Visual Basic ruled the world.Basically it's a one user database. You can have more than one user but it's done by multiple users accessing the same database file.
user -> application -> sqlite -> database file
This in contrast to client-server databases such as mysql, sql server, oracle, etc. Multiple users would be accomplished by multiple clients connecting to the same server.
user -> application -> mysql client -> mysql server -> many db files
-
@Pete-S said in How to Rename a Column in SQLite Database:
There used to be a lot of databases like SQLite. Often called database engines. dBase was probably one of the first.
Later Microsoft Jet engine (aka Microsoft Access) became popular when Visual Basic ruled the world.
Basically it's a one user database. You can have more than one user but it's done by multiple users accessing the same database file.Or by having an application on top that accessing the file and shares it out. That thing can be called a "database management system" or any application, really.
All databases use database engines. MySQL, for example, isn't a database. It's a database management system. It uses one or more database engines to talk to the files on disk. MyISAM and InnoDB are two database engine options for the MySQL platform.
At the end of the day, all databases work like SQlite. You can easily build your own database management system that uses SQlite as the engine and it could work just like MySQL or Oracle or SQL Server. Those are all single users to a file, under the hood. They just have the "multi-access" management built into an extra layer, instead of letting an application handle it.
But for most things, you only access a database from a single app anyway, so that extra layer is often unnecessary as it is redundant. Just adds overhead.