# Sqlite3 & NULL == chaos?

**URL:** <https://www.ruby-forum.com/t/sqlite3-null-chaos/106512>\
**Category:** Radiant CMS\
**Created:** [June 11, 2007, 2:03pm UTC](https://www.ruby-forum.com/t/sqlite3-null-chaos/106512 "2007-06-11T14:03:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aitor\_Garay-Romero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@Aitor\_Garay-Romero](https://www.ruby-forum.com/u/Aitor_Garay-Romero)\
**Post date:** [June 11, 2007, 2:03pm UTC](https://www.ruby-forum.com/t/sqlite3-null-chaos/106512/1 "2007-06-11T14:03:50Z")

</div>

Hi there!,

```
I did some research regarding my post:

http://lists.radiantcms.org/pipermail/radiant/2007-June/005165.html

In summary the problem is that i get an exception in

```

app/views/admin/page/edit.rhtml when calling  
“filter\_reference(default\_filter\_name)”:

---- 8\< ----

### \<%= default\_filter\_name %\> Reference

\<%= filter\_reference(default\_filter\_name) %\>

\<%= link\_to\_function 'Close', "Element.hide('filter-reference-popup')", :class =\> 'close-link' %\>

---- 8\< ----

```
 After some debugging i found that in my sqlite3 database, fields

```

of type “string” have a weird default value in the schema, and not a  
default NULL value. This is for all tables.

```
For example this is the schema for the table "page_parts" reported

```

by sqlite3:

CREATE TABLE page\_parts (“id” INTEGER PRIMARY KEY NOT NULL, “name”  
varchar(100) DEFAULT ‘’‘NULL’’’, “filter\_id” varchar(25) DEFAULT  
‘’‘NULL’’’, “content” text DEFAULT ‘’‘NULL’’’, “page\_id” integer  
DEFAULT 0);

The default value is the string “‘NULL’” or whatever, but not the  
raw NULL value. I have verified this in the rails console and with  
rdebug.

This is what is causing me problems + other strange behaviors.

Did someone have this problem with sqlite3? It’s a problem of my  
sqlite3 bindings?

/AITOR

---

<div class="post-metadata">

**Author:** ![Aitor\_Garay-Romero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@Aitor\_Garay-Romero](https://www.ruby-forum.com/u/Aitor_Garay-Romero)\
**Post date:** [June 11, 2007, 2:29pm UTC](https://www.ruby-forum.com/t/sqlite3-null-chaos/106512/2 "2007-06-11T14:29:54Z")

</div>

On 6/11/07, Aitor Garay-Romero [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> After some debugging i found that in my sqlite3 database, fields
> 
> ```
> 
> of type “string” have a weird default value in the schema, and not a  
> default NULL value. This is for all tables.

Read this first:  
[http://weblog.rubyonrails.com/2007/1/29/using-sqlite3-with-rails](http://weblog.rubyonrails.com/2007/1/29/using-sqlite3-with-rails)

---

<div class="post-metadata">

**Author:** ![Aitor\_Garay-Romero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@Aitor\_Garay-Romero](https://www.ruby-forum.com/u/Aitor_Garay-Romero)\
**Post date:** [June 12, 2007, 12:24pm UTC](https://www.ruby-forum.com/t/sqlite3-null-chaos/106512/3 "2007-06-12T12:24:29Z")

</div>

Thanks for the info, now it’s working. I updated my debian system  
to get the latest sqlite3 and the installation instructions at  
[http://dev.radiantcms.org/radiant/wiki/Installation](http://dev.radiantcms.org/radiant/wiki/Installation) .

The “db:bootstrap” is still not creating the admin user though.  
“script/console” is also failing, i will comment this in a separate  
thread.

/AITOR

---

<div class="post-metadata">

**Author:** ![Aitor\_Garay-Romero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@Aitor\_Garay-Romero](https://www.ruby-forum.com/u/Aitor_Garay-Romero)\
**Post date:** [June 12, 2007, 1:06pm UTC](https://www.ruby-forum.com/t/sqlite3-null-chaos/106512/4 "2007-06-12T13:06:38Z")

</div>

> The “db:bootstrap” is still not creating the admin user though.

```
I was wrong. It's working correctly on my system.

/AITOR
```

---

<div class="post-metadata">

**Author:** ![Aitor\_Garay-Romero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@Aitor\_Garay-Romero](https://www.ruby-forum.com/u/Aitor_Garay-Romero)\
**Post date:** [June 12, 2007, 12:58pm UTC](https://www.ruby-forum.com/t/sqlite3-null-chaos/106512/5 "2007-06-12T12:58:35Z")

</div>

> “script/console” is also failing, i will comment this in a separate  
> thread.

I discovered that this was solved on revision 448  
([http://dev.radiantcms.org/radiant/changeset/448](http://dev.radiantcms.org/radiant/changeset/448)).

/AITOR
